W
Wasp2mo ago
Sven

304 error on auth/me after signing up

Kapa when i signed up and try to access a page for which authRequired is set to True. I can't access page and auth/me returns a 304 status.
4 Replies
kapa.ai
kapa.ai2mo ago
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, I can offer some insights into your issue with the 304 error on auth/me after signing up. However, it's important to note that the exact behavior you're experiencing isn't directly addressed in the given documents. When you sign up in a Wasp application, you are not automatically logged in. This behavior is mentioned in a GitHub issue here (https://github.com/wasp-lang/wasp/issues/151), which states that after calling signup(), you still need to call login(). Regarding the 304 status code on /auth/me, this typically indicates that the resource hasn't been modified since the last request. It's not necessarily an error, but it might not be providing the updated authentication information you're expecting. For pages with authRequired: true, Wasp should redirect unauthenticated users to the login page, as specified in the Wasp documentation (https://wasp-lang.dev/docs/auth/overview#protecting-a-page-with-authrequired). If you're not being redirected, it's possible that there's an issue with the authentication flow in your application. To troubleshoot this issue, you could try the following: 1. Ensure that you're calling login() after signup(). 2. Check if your login process is correctly setting the authentication token. 3. Verify that your app.auth.onAuthFailedRedirectTo field is correctly set in your Wasp configuration. If the problem persists, it might be helpful to examine the network requests in your browser's developer tools to see the exact sequence of calls being made and their responses. For a more definitive answer or solution, you may need to provide more details about your specific implementation or consider reaching out to the Wasp community through their official channels for support. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Sven, 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?
Filip
Filip2mo ago
@Sven Still need help with this or is it fixed?
Sven
SvenOP2mo ago
Nope Fixed Due to an endpoint returning 401 i got logged out
Filip
Filip2mo ago
Excellent! Glad you got it working

Did you find this page helpful?