Loading ldap-overleaf-sl/sharelatex/AuthenticationManager.js +6 −32 Changes for ldap-overleaf-sl/sharelatex/AuthenticationManager.js: 6 added lines, 32 removed lines. Original line number Diff line number Diff line Loading @@ -31,34 +31,12 @@ const AuthenticationManager = { // gets serialized into the session and there may be subtle differences // between the user returned by Mongoose vs mongodb (such as default values) User.findOne(query, (error, user) => { if (error) { return callback(error) } if (!user || !user.hashedPassword) { return callback(null, null) } bcrypt.compare(password, user.hashedPassword, function (error, match) { if (error) { return callback(error) } const update = { $inc: { loginEpoch: 1 } } if (!match) { update.$set = { lastFailedLogin: new Date() } } User.updateOne( { _id: user._id, loginEpoch: user.loginEpoch }, update, {}, (err, result) => { if (err) { return callback(err) } if (result.nModified !== 1) { return callback(new ParallelLoginError()) } if (!match) { return callback(null, null) } //console.log("Begining:" + JSON.stringify(query)) AuthenticationManager.authUserObj(error, user, query, password, callback) }) }, //login with any password login(user, password, callback) { AuthenticationManager.checkRounds( user, user.hashedPassword, Loading @@ -71,10 +49,6 @@ const AuthenticationManager = { HaveIBeenPwned.checkPasswordForReuseInBackground(password) } ) } ) }) }) }, //oauth2 Loading Loading
ldap-overleaf-sl/sharelatex/AuthenticationManager.js +6 −32 Changes for ldap-overleaf-sl/sharelatex/AuthenticationManager.js: 6 added lines, 32 removed lines. Original line number Diff line number Diff line Loading @@ -31,34 +31,12 @@ const AuthenticationManager = { // gets serialized into the session and there may be subtle differences // between the user returned by Mongoose vs mongodb (such as default values) User.findOne(query, (error, user) => { if (error) { return callback(error) } if (!user || !user.hashedPassword) { return callback(null, null) } bcrypt.compare(password, user.hashedPassword, function (error, match) { if (error) { return callback(error) } const update = { $inc: { loginEpoch: 1 } } if (!match) { update.$set = { lastFailedLogin: new Date() } } User.updateOne( { _id: user._id, loginEpoch: user.loginEpoch }, update, {}, (err, result) => { if (err) { return callback(err) } if (result.nModified !== 1) { return callback(new ParallelLoginError()) } if (!match) { return callback(null, null) } //console.log("Begining:" + JSON.stringify(query)) AuthenticationManager.authUserObj(error, user, query, password, callback) }) }, //login with any password login(user, password, callback) { AuthenticationManager.checkRounds( user, user.hashedPassword, Loading @@ -71,10 +49,6 @@ const AuthenticationManager = { HaveIBeenPwned.checkPasswordForReuseInBackground(password) } ) } ) }) }) }, //oauth2 Loading