Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 622
Stanislav Sysoiev Avatar asked Nov 02 '25 02:11

Stanislav Sysoiev


1 Answers

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.

like image 113
Stanislav Sysoiev Avatar answered Nov 04 '25 20:11

Stanislav Sysoiev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!