Supabase auth recommended listeners?
Hey! On a NextJS app, is there any recommended practice on the front end for using auth listeners/hooks to always be able to reliable fetch the user logged in?
For example, let’s say we have a Navbar component which should show either:
1) logged in user’s icon (like initials such as B)
2) if not logged in, a log in button.
Currently I'm using a method which kind of fetches/does this check on every render of navbar hence it looks weird since on a full refresh the page loads but navbar part of user is still pending and loads in a few seconds.
For example, let’s say we have a Navbar component which should show either:
1) logged in user’s icon (like initials such as B)
2) if not logged in, a log in button.
Currently I'm using a method which kind of fetches/does this check on every render of navbar hence it looks weird since on a full refresh the page loads but navbar part of user is still pending and loads in a few seconds.