Thanks for the tutorial, well explained. One thing I'm not sure about is how it actually checks that the current user visiting the page is matching the cookie stored on the server. What exactly is it comparing it with?
Hey man, how do you use route controls for something like Premium Users or different membership tiers (Gold, Silver, Platinum memberships, etc). All tutorials out there explain perfectly the case for global authentication of users, but none of them show an actual example of this kind of granular access. Great channel btw, just subscribed.
I’m having an issue with token refresh. Once it expires, I can’t access protected routes as server returns null for user. Has anyone encountered that as well?
great tutorial! I was following it and concerting code to just pure react... some of the functions don't work... like could you suggest how to redefine handleAuthChange function that is fetching from api folder? in pure react this doesn't work await fetch('/api/auth', { ...
Hello! Nader. I have a question. My team is building an application with supabase but we need to retrieve after registration if the email already exists... if not, register the user. Is it possible? We don't have access to the User's table.
Thanks for this. I've been building something recently and wondered if It was best practice to ping Supabase to check auth status on EVERY page load. Isn't that what we're doing here? Thanks again.
it's actually checking either localstorage or the cookie storage (also locally) and, if the token is not yet expired, returning the signed in user, so there is no round trip to the server
@@naderdabit what happens when it expires , i am assuming it will get the user back to the login screen since there is no cookie now . and the expiry can be set from the supabase if i am correct