chore: Apply linting & formatting

This commit is contained in:
Yarmo Mackenbach 2023-03-28 10:37:43 +02:00
parent 99fe8edd71
commit 786e9cdd3e
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
5 changed files with 8 additions and 10 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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)

View file

@ -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)

View file

@ -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)