blank page on authorized pages

Hi everyone, I can’t replicate this 100% of the time but periodically in authorized pages when I hit the Back button on my browser, the page is rendered as a white page. I confirmed that the access token is not expired since this can happen shortly after I just logged in.
13 Replies
kapa.ai
kapa.ai9mo ago
Hi @crunchyTaco. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, it's worth noting that Wasp provides an authRequired property that you can set to true for pages that require authentication. If authRequired is set to true, only authenticated users can access the page. Unauthenticated users are redirected to a route defined by the app.auth.onAuthFailedRedirectTo field. Here is an example of how to use it:
page MainPage {
component: import Main from "@src/pages/Main",
authRequired: true
}
page MainPage {
component: import Main from "@src/pages/Main",
authRequired: true
}
You can read more about this in the Wasp documentation (https://wasp-lang.dev/docs/auth/overview#protecting-a-page-with-authrequired). If you're still experiencing issues, it might be helpful to check the console for any error messages or warnings. These could provide more insight into what's causing the blank page to appear. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @crunchyTaco, 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?
miho
miho9mo ago
That's an interesting insight, thanks! Did you find a consitent way to reproduce it? 🤔
crunchyTaco
crunchyTacoOP9mo ago
I have not. Any idea what could cause this?
miho
miho9mo ago
I'll have to debug, any pointers what kind of app should I try it with?
martinsos
martinsos9mo ago
Interesting that it is only authorized pages. So, must be connected with the authentication :D. I am guessing that what's happening is that user is being fetched, and page is blank during that -> but wait @crunchyTaco , is the page blank for a short moment, or does it stay blank?
crunchyTaco
crunchyTacoOP9mo ago
The page continue to stay blank. I have a feeling this is something relate to how the session cookies are being stored and used. Let me continue digging and I’ll report back if I find anything interesting. Thank you folks
miho
miho9mo ago
I'll do the same 🙋‍♂️ When you experience the issue, did you check the browser console? Or the terminal? Did you see any errors? I've tried getting the blank page but with no luck.
martinsos
martinsos9mo ago
One more question: does this happen during development, in production, or both? What will certainly help is getting those console logs
Vinny (@Wasp)
Vinny (@Wasp)9mo ago
and what version of wasp is it? could it be related to the 0.13.0 bug?
crunchyTaco
crunchyTacoOP9mo ago
I’m running on version .13. This is happening in production. I haven’t been able to replicate it locally, on development instance.
miho
miho9mo ago
If you could share the link 🙏🏼 I'll play around with it
Want results from more Discord servers?
Add your server