angularauthenticationauth0autologin

Auth0. How to prevent auto login


If successfully logged in using password-login strategy login form not appear when trying to log in next times, but user automatically logging in. How to prevent this behavior? I want login form to appear every time after user log out. I using Angular 6.


Solution

  • Solution:
    When you clean local storage as shown in tutorials - you logged out from your app, but because of SSO you are still logged in on Auth0 side. To logged out compleatly you need to do redirection to "logout url" on Auth0. You can do something like that:
    document.location.href = 'https://[YOUR_APP_ON_AUTH0]/v2/logout?returnTo=http%3A%2F%2F[YOUR_APP_HOME_PAGE]'
    Also you need to fill Allowed Logout URLs here and Allowed Logout URLs in your application settings.