everyauth
everyauth copied to clipboard
Success Redirect ??
Why I would have to write an address redirection. Sometimes what you want is to go to the login page where the user made. That is if you did login anywhere http://www.example.com/my/path
, is supposed to be back there, not http://www.example.com/
.
everyauth.facebook
.appId('bla')
.appSecret('bla')
.handleAuthCallbackError(function(req, res) {
//The code...
})
.findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetadata) {
//The code...
}).redirectPath('/'); // See!!
Not run the application if not placed this redirect, and it becomes a nightmare for the user!
try this
everyauth.facebook
.appId('bla')
.appSecret('bla')
.handleAuthCallbackError(function(req, res) {
//The code...
})
.findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetadata) {
//The code...
this.redirectPath('/');
})
this should allow you to change redirect path progmaticly
but not run if the parameter or function is not redirectPath