Skip to content
Snippets Groups Projects
Verified Commit 9f1b504e authored by David Mehren's avatar David Mehren Committed by David Mehren
Browse files

Adapt LDAP code in AuthenticationController to new APIs


Signed-off-by: default avatarDavid Mehren <dmehren1@gmail.com>
parent a413c940
No related branches found
No related tags found
No related merge requests found
...@@ -79,15 +79,7 @@ const AuthenticationController = { ...@@ -79,15 +79,7 @@ const AuthenticationController = {
if (err) if (err)
return next(err); return next(err);
if (user) { if (user) {
// does not seem to get the correct redirect. return AuthenticationController.finishLogin(user, req, res, next)
// let redir = AuthenticationController._getRedirectFromSession(req) || "project";
let redir = "project";
AuthenticationController.afterLoginSessionSetup(req, user, function (err) {
if (err)
return next(err);
AuthenticationController._clearRedirectFromSession(req);
res.json({redir: redir});
})
} else { } else {
res.json({message: {text: info.message, type: "error"}}) res.json({message: {text: info.message, type: "error"}})
} }
...@@ -190,14 +182,6 @@ const AuthenticationController = { ...@@ -190,14 +182,6 @@ const AuthenticationController = {
return done(error); return done(error);
} }
if (user != null) { if (user != null) {
UserHandler.setupLoginData(user,);
LoginRateLimiter.recordSuccessfulLogin(ldapUser.mail);
AuthenticationController._recordSuccessfulLogin(user._id);
Analytics.recordEvent(user._id, 'user-logged-in', {ip: req.ip});
Analytics.identifyUser(user._id, req.sessionID);
logger.log({email: ldapUser.mail, user_id: user._id.toString()}, 'successful log in');
req.session.justLoggedIn = true;
user._login_req_ip = req.ip;
return done(null, user); return done(null, user);
} else { } else {
AuthenticationController._recordFailedLogin(); AuthenticationController._recordFailedLogin();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment