fix: code lint
This commit is contained in:
@@ -79,15 +79,15 @@ module.exports = {
|
||||
stg.config.callbackURL = `${WIKI.config.host}/login/${stg.key}/callback`
|
||||
strategy.init(passport, stg.config)
|
||||
|
||||
fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${strategy.key}.svg`), 'utf8').then(iconData => {
|
||||
strategy.icon = iconData
|
||||
}).catch(err => {
|
||||
try {
|
||||
strategy.icon = await fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${strategy.key}.svg`), 'utf8')
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
strategy.icon = '[missing icon]'
|
||||
} else {
|
||||
WIKI.logger.warn(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
WIKI.auth.strategies[stg.key] = strategy
|
||||
WIKI.logger.info(`Authentication Strategy ${stg.key}: [ OK ]`)
|
||||
}
|
||||
|
@@ -1,7 +1,5 @@
|
||||
/* global WIKI */
|
||||
|
||||
const _ = require('lodash')
|
||||
const securityHelper = require('../helpers/security')
|
||||
const Model = require('objection').Model
|
||||
const moment = require('moment')
|
||||
const nanoid = require('nanoid')
|
||||
@@ -68,7 +66,5 @@ module.exports = class UserKey extends Model {
|
||||
} else {
|
||||
throw new WIKI.Error.AuthValidationTokenInvalid()
|
||||
}
|
||||
|
||||
return token
|
||||
}
|
||||
}
|
||||
|
@@ -387,7 +387,7 @@ module.exports = () => {
|
||||
let key = conn.remoteAddress + ':' + conn.remotePort
|
||||
openConnections[key] = conn
|
||||
conn.on('close', () => {
|
||||
delete openConnections[key]
|
||||
openConnections.splice(key, 1)
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user