fixed location of onSuccessfulLogin call

This commit is contained in:
Julian Lam 2016-04-13 18:33:23 -04:00
parent e301e6b8bf
commit 74ae8adace

View File

@ -79,7 +79,6 @@
if (err) return done(err); if (err) return done(err);
profile.provider = constants.name; profile.provider = constants.name;
authenticationController.onSuccessfulLogin(req, user.uid);
done(null, profile); done(null, profile);
}); });
} catch(e) { } catch(e) {
@ -102,7 +101,6 @@
if (err) return done(err); if (err) return done(err);
profile.provider = constants.name; profile.provider = constants.name;
authenticationController.onSuccessfulLogin(req, user.uid);
done(null, profile); done(null, profile);
}); });
} catch(e) { } catch(e) {
@ -112,7 +110,9 @@
}; };
} }
passport.use(constants.name, new passportOAuth(opts, function(token, secret, profile, done) { opts.passReqToCallback = true;
passport.use(constants.name, new passportOAuth(opts, function(req, token, secret, profile, done) {
OAuth.login({ OAuth.login({
oAuthid: profile.id, oAuthid: profile.id,
handle: profile.displayName, handle: profile.displayName,
@ -122,6 +122,8 @@
if (err) { if (err) {
return done(err); return done(err);
} }
authenticationController.onSuccessfulLogin(req, user.uid);
done(null, user); done(null, user);
}); });
})); }));