From my current understanding:
You cannot check if a session cookie exists, so the only way to securely check if a user is logged in is to call GetUser from Supabase. If the token isn't expired, it will return a 200 status with data. If you encounter an error, you should try to refresh the token. However, currently, you cannot set or get the refresh token from a session cookie, so you need to store the refresh token inside local storage. If you cannot find it or if you get an error from the refresh request, your user should be returned to the login screen.