I’m encountering an issue with user redirection to the login page upon receiving a 401 error from the server. I have set up my get user API so that when an invalid or expired token is detected, the server returns a 401 Unauthorized status. However, it appears that the Weweb does not redirect the user to the login page when this error is returned.
Could you help me troubleshoot this? Specifically:
- Are there specific conditions in the Weweb that control redirection for 401 errors while fetching user?
- Should there be additional headers or error details in the response payload to trigger the redirect?
For reference, here is an example of the 401 response structure I’m getting from the server
I see that browser recognises 401 correctly.