hko
02/02/2022, 4:18 PMhko
02/02/2022, 4:34 PM/api/auth
endpoint that sets a cookie based on https://supabase.com/docs/reference/javascript/auth-setauth .
api/auth
is called with onAuthStateChange()
. However, when logging in, the app tries to fetch content from /api/get
before the cookie is returned, thus failing with the request. What's an elegant way to handle the login and protect pages?hko
02/02/2022, 4:37 PMhko
02/03/2022, 7:32 PMisAuthenticated
method in a composable, that checks if the supabase authentication has completed and the API has set the cookie. This largely works, however, I'm getting a "Auth session missing!" when loading, possibly because when the server side tries to hydrate?