mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
chore: Apply linting & formatting
This commit is contained in:
parent
99fe8edd71
commit
786e9cdd3e
5 changed files with 8 additions and 10 deletions
|
@ -327,7 +327,7 @@ router.get('/profile/fetch',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.errors.length > 0) {
|
if (data.errors.length > 0) {
|
||||||
delete data.key
|
data.key = undefined
|
||||||
res.status(500).send(data)
|
res.status(500).send(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ router.get('/profile/fetch',
|
||||||
if (req.query.returnPublicKey) {
|
if (req.query.returnPublicKey) {
|
||||||
data.keyData.key.data = data.key.publicKey
|
data.keyData.key.data = data.key.publicKey
|
||||||
}
|
}
|
||||||
delete data.key
|
data.key = undefined
|
||||||
|
|
||||||
// Do verification
|
// Do verification
|
||||||
if (req.query.doVerification) {
|
if (req.query.doVerification) {
|
||||||
|
|
|
@ -298,7 +298,7 @@ router.get('/fetch',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.errors.length > 0) {
|
if (data.errors.length > 0) {
|
||||||
delete data.key
|
data.key = undefined
|
||||||
res.status(500).send(data)
|
res.status(500).send(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ router.get('/fetch',
|
||||||
if (req.query.returnPublicKey) {
|
if (req.query.returnPublicKey) {
|
||||||
data.keyData.key.data = data.key.publicKey
|
data.keyData.key.data = data.key.publicKey
|
||||||
}
|
}
|
||||||
delete data.key
|
data.key = undefined
|
||||||
|
|
||||||
// Do verification
|
// Do verification
|
||||||
if (req.query.doVerification) {
|
if (req.query.doVerification) {
|
||||||
|
|
|
@ -118,9 +118,7 @@ router.get(
|
||||||
query('id').isEmail(),
|
query('id').isEmail(),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
if (
|
if (
|
||||||
!opts.claims.xmpp.service ||
|
!((opts.claims.xmpp.service && opts.claims.xmpp.username) && opts.claims.xmpp.password)
|
||||||
!opts.claims.xmpp.username ||
|
|
||||||
!opts.claims.xmpp.password
|
|
||||||
) {
|
) {
|
||||||
return res.status(501).json({ errors: 'XMPP not enabled on server' })
|
return res.status(501).json({ errors: 'XMPP not enabled on server' })
|
||||||
}
|
}
|
||||||
|
@ -166,7 +164,7 @@ router.get(
|
||||||
query('roomId').isString(),
|
query('roomId').isString(),
|
||||||
query('eventId').isString(),
|
query('eventId').isString(),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
if (!opts.claims.matrix.instance || !opts.claims.matrix.accessToken) {
|
if (!(opts.claims.matrix.instance && opts.claims.matrix.accessToken)) {
|
||||||
return res.status(501).json({ errors: 'Matrix not enabled on server' })
|
return res.status(501).json({ errors: 'Matrix not enabled on server' })
|
||||||
}
|
}
|
||||||
const errors = validationResult(req)
|
const errors = validationResult(req)
|
||||||
|
|
|
@ -151,7 +151,7 @@ const generateSignatureProfile = async (signature) => {
|
||||||
.then(async key => {
|
.then(async key => {
|
||||||
let keyData = key.keyData
|
let keyData = key.keyData
|
||||||
keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}`
|
keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}`
|
||||||
delete key.keyData
|
key.keyData = undefined
|
||||||
keyData.key.data = {}
|
keyData.key.data = {}
|
||||||
keyData = processKeyData(keyData)
|
keyData = processKeyData(keyData)
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ const fetchWKD = (id) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const [, localPart, domain] = /([^@]*)@(.*)/.exec(id)
|
const [, localPart, domain] = /([^@]*)@(.*)/.exec(id)
|
||||||
if (!localPart || !domain) {
|
if (!(localPart && domain)) {
|
||||||
reject(new Error(`The WKD identifier "${id}" is invalid`))
|
reject(new Error(`The WKD identifier "${id}" is invalid`))
|
||||||
}
|
}
|
||||||
const localEncoded = await computeWKDLocalPart(localPart)
|
const localEncoded = await computeWKDLocalPart(localPart)
|
||||||
|
|
Loading…
Reference in a new issue