Page with optional auth - How to get user data in React if the user is signed in?
If I set
BUT, if I set
How do I make a page with auth "optional" (user doesn't have to be signed in to access it) but get the user data if the user does happen to be signed in?
authRequired: true on a page in main.wasp, then I can get the user data just fine in the React front-end like:BUT, if I set
authRequired: false in main.wasp, then that user object is undefined.How do I make a page with auth "optional" (user doesn't have to be signed in to access it) but get the user data if the user does happen to be signed in?