calling onSuccessfulLogin on successful login
This commit is contained in:
parent
d1d9ab0cee
commit
354850244b
10
library.js
10
library.js
@ -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) {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user