summaryrefslogtreecommitdiff
path: root/lib/web/auth/ldap
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/web/auth/ldap/index.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/web/auth/ldap/index.js b/lib/web/auth/ldap/index.js
index b501106d..4142194f 100644
--- a/lib/web/auth/ldap/index.js
+++ b/lib/web/auth/ldap/index.js
@@ -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