everyauth icon indicating copy to clipboard operation
everyauth copied to clipboard

Success Redirect ??

Open jamlfy opened this issue 12 years ago • 2 comments

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!

jamlfy avatar Dec 16 '12 22:12 jamlfy

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

bmatusiak avatar Jan 04 '13 17:01 bmatusiak

but not run if the parameter or function is not redirectPath

jamlfy avatar Jan 04 '13 22:01 jamlfy