Problem:
Race condition:
Reloading the app redirects to login page too early, meaning before the credentials are reset and the user is automatically logged in.
The AuthGuard is triggered before the app finished resetting the credentials in the backgroud
Solution
Use the APP_INITIALIZER hook to run the code that reset the credentials, firing the appropriate actions before the AuthGuard is called.
No comments:
Post a Comment