I am using Auth0 Single Page App SDK, do I have to be redirected to a new page after login?

after createAuth0Client, I am using auth0.loginWithRedirect. Could I stay same page without refreshing or redirecting to a new page after login? could I use javascript function to handle post-login action. I tried auth0.handleRedirectCallback, but it wouldn’t be triggered. which function/parameters should I use? thanks.

Hi @gwtractorcontact,

Welcome to the Auth0 Community!

I understand that you have questions regarding login redirection.

Unfortunately, the Auth0 Single Page Application SDK only supports loginWithPopup and loginWithRedirect methods. Because of this, you will not be able to avoid a page redirection or refresh.

With that said, I recommend that you use the loginWithRedirect method to your same page to authenticate the user and allow them onto the application for their account. Or use loginWithPopup and refresh the current page.

Please let me know if you have any questions. I would be happy to help.

EDIT:

Yes, you can use a Post-Login Action to implement custom behavior after the user has authenticated.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.