calling onSuccessfulLogin on successful login

This commit is contained in:
Julian Lam 2016-03-30 12:09:31 -04:00
parent d1d9ab0cee
commit 354850244b
2 changed files with 9 additions and 3 deletions

View File

@ -25,9 +25,11 @@
path = module.parent.require('path'),
nconf = module.parent.require('nconf'),
winston = module.parent.require('winston'),
async = module.parent.require('async'),
async = module.parent.require('async');
constants = Object.freeze({
var authenticationController = module.parent.require('./controllers/authentication');
var constants = Object.freeze({
type: '', // Either 'oauth' or 'oauth2'
name: '', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb"
oauth: {
@ -76,6 +78,8 @@
OAuth.parseUserReturn(json, function(err, profile) {
if (err) return done(err);
profile.provider = constants.name;
authenticationController.onSuccessfulLogin(req, user.uid);
done(null, profile);
});
} catch(e) {
@ -97,6 +101,8 @@
OAuth.parseUserReturn(json, function(err, profile) {
if (err) return done(err);
profile.provider = constants.name;
authenticationController.onSuccessfulLogin(req, user.uid);
done(null, profile);
});
} catch(e) {

View File

@ -31,7 +31,7 @@
"passport-oauth": "~1.0.0"
},
"nbbpm": {
"compatibility": "^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0",
"compatibility": "^1.0.1",
"index": false
}
}