Error 401 with authentication
Hello, quick question regarding the authentication, i get two warning and auth page looks different in terms of style. I have also open the incident #253.
GET /auth/me 304
GET /auth/me 401
Any idra or solution/workaround for this?
Thanks
5 Replies
Hi @DanjelDurmo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The
GET /auth/me 401
error indicates that the client is unauthorized, meaning it has provided no credentials or invalid credentials. This is a common issue when dealing with authentication in Wasp.
There are a few potential solutions or workarounds for this issue:
1. Differentiate between an invalid/old auth and making a request without an auth token: As discussed in Github Issue #1227 (https://github.com/wasp-lang/wasp/issues/1227), the current behavior is to clear the auth token when a 401 response is received. This can cause issues if you have multiple tabs open and are logged in on one but not the other. The proposed solution is to differentiate between an invalid/old auth, where the auth token should be cleared, and making a request without an auth token.
2. Improve error messaging: Instead of showing the raw 401
message, you could show a more user-friendly message like "Your login credentials are invalid". This is suggested in Github Issue #1114 (https://github.com/wasp-lang/wasp/issues/1114).
3. Debugging: For more detailed information about why the 401 error is happening, you could improve the information provided during development when an error happens on the server. This is suggested in Github Issue #91 (https://github.com/wasp-lang/wasp/issues/91).
Remember to always check your environment variables and ensure that you are providing the correct credentials. If you're still encountering issues, it might be helpful to open a new issue in the Wasp Github repository or ask for help in the Wasp Discord community.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @DanjelDurmo, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Seeing
doesn't mean something is broken, it usually just the backend saying to the frontend the user is not logged in and that's buisness as usual.
What do you mean by
I have also open the incident #253.Is something not working for you and that's why you are asking about this?
He opened an issue in the Open SaaS repo as well.
That’s what he’s referring to
Thank @miho for your explanation, I will cose the issue.
I’m have asked about this because a strange behaviour happens with the design of login/signup page without relevant change and I thought it might be caused by this.
Please have a look to the screenshot, by doing nothing the design of pages was broken.
Issue solved, i have modified the layout in to .wasp/out/sdk/wasp/dist/auth/forma/Auth.jsx but those changes was deleted by system (maybe after rebuild). Thanks
DD