I'm working on a node express app, and I've got it working well with the Facebook authentication already. I'm now attempting to enable our own email/password login and running it to a roadblock. With Facebook I am able to access and write to the session during auth:
everyauth.faceboook
// Basic stuff
.findOrCreateUser( function( sess, accessToken, extra, fbUser) {
var promise = this.Promise();
sess.myvar = myvar
// Find user in DB, etc
promise.fulfill(fbUser);
return promise()
This works great as I can save some stuff I need later to the session right in this method. But I'm not sure how to do the same thing when using everyauth password login:
everyauth.password
// Basic stuff
.authenticate( function(email, password) {
var promise = this.Promise();
// Create new user in DB, etc
// Now I need to save stuff to the session but I'm not sure how to access
// it in here...
promise.fulfill(newUser)
return promise
So is there any way to access the session in the authenticate and login methods (which use the same API) of everyauth.password?