0

Just didn't get how to do custom response (send or render) on successfull auth with provider (facebook, etc):

handleAuthCallbackError method has request and respose parameters and I can do: response.render or response.send

but

findOrCreateUser does not have responce parameter to render or send something custom, and redirectPath just do the redirect.

Thanks.

WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181

1 Answers1

1

I guess you want to listen for respondToLoginSucceed and respondToRegistrationSucceed. They both have a response parameter.

edit Normal way to do this is to call .redirectPath('/yay/login/succeeded'); and register it in Express the normal way.

app.get("/yay/login/suceeded", function (req, res) {
    // do custom headers
});

The reason you want to do it this way is that you have a state free page that can be refreshed etc. without any side effects.

Jan Jongboom
  • 26,598
  • 9
  • 83
  • 120
  • Well, it seems that this method can be used only for for "password" strategy. I need for providers (facebook ets..) – WHITECOLOR Dec 12 '11 at 11:49
  • See my edit. It's the standard way of doing it in EveryAuth, but it has some good arguments. Try to work around it by using the redirectPath, if it's not possible please elaborate on the use case. – Jan Jongboom Dec 13 '11 at 09:30
  • Yes, thanks, I did it using that method. Actually I needed to close the window that I created and for facebook login after callback. So I did it by sending javascript winodow.close() – WHITECOLOR Dec 13 '11 at 12:01