mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Linter: Fix all lint errors
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
b0a45bdf9c
commit
136d895d15
51 changed files with 2245 additions and 1539 deletions
|
@ -9,7 +9,7 @@ const logger = require('../../../logger')
|
|||
const { urlencodedParser } = require('../../utils')
|
||||
const errors = require('../../../errors')
|
||||
|
||||
let ldapAuth = module.exports = Router()
|
||||
const ldapAuth = module.exports = Router()
|
||||
|
||||
passport.use(new LDAPStrategy({
|
||||
server: {
|
||||
|
@ -22,7 +22,7 @@ passport.use(new LDAPStrategy({
|
|||
tlsOptions: config.ldap.tlsOptions || null
|
||||
}
|
||||
}, function (user, done) {
|
||||
var uuid = user.uidNumber || user.uid || user.sAMAccountName || undefined
|
||||
let uuid = user.uidNumber || user.uid || user.sAMAccountName || undefined
|
||||
if (config.ldap.useridField && user[config.ldap.useridField]) {
|
||||
uuid = user[config.ldap.useridField]
|
||||
}
|
||||
|
@ -34,12 +34,12 @@ passport.use(new LDAPStrategy({
|
|||
'"useridField" option in ldap settings.')
|
||||
}
|
||||
|
||||
var username = uuid
|
||||
let username = uuid
|
||||
if (config.ldap.usernameField && user[config.ldap.usernameField]) {
|
||||
username = user[config.ldap.usernameField]
|
||||
}
|
||||
|
||||
var profile = {
|
||||
const profile = {
|
||||
id: 'LDAP-' + uuid,
|
||||
username: username,
|
||||
displayName: user.displayName,
|
||||
|
@ -48,7 +48,7 @@ passport.use(new LDAPStrategy({
|
|||
profileUrl: null,
|
||||
provider: 'ldap'
|
||||
}
|
||||
var stringifiedProfile = JSON.stringify(profile)
|
||||
const stringifiedProfile = JSON.stringify(profile)
|
||||
models.User.findOrCreate({
|
||||
where: {
|
||||
profileid: profile.id.toString()
|
||||
|
@ -58,7 +58,7 @@ passport.use(new LDAPStrategy({
|
|||
}
|
||||
}).spread(function (user, created) {
|
||||
if (user) {
|
||||
var needSave = false
|
||||
let needSave = false
|
||||
if (user.profile !== stringifiedProfile) {
|
||||
user.profile = stringifiedProfile
|
||||
needSave = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue