It doesn't navigate to login page if status code is 401 #651
Answered
by
ju4n97
sankaSanjeeva
asked this question in
Q&A
-
My API returns 401 for an invalid token. But the application doesn't navigate to the login page
|
Beta Was this translation helpful? Give feedback.
Answered by
ju4n97
Nov 23, 2023
Replies: 1 comment
-
@sankaSanjeeva Thank you for pointing out the issue! This is in fact due to the auth guard. {
path: 'auth',
loadChildren: async () => (await import('@pages/auth')).routes,
canMatch: [authGuard({ requiresAuthentication: false })],
} This code is responsible for loading the authentication routes only when the user is not authenticated. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ju4n97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sankaSanjeeva Thank you for pointing out the issue! This is in fact due to the auth guard.
This code is responsible for loading the authentication routes only when the user is not authenticated.