Refresh auth component

I have an auth component in my navbar that either renders login and signup or a user profile button. When the user logs in I want that component to automatically rebuild, but right now after they sign in it still says login and signup until you refresh the page. So the login is working but its not updating the authcomponent. I was thinking I could add some sort of onAuthStateChange to the auth component, but I dont know what to do inside the function to make it rebuild.

Side question: When reading the supabase docs i never read anything about creating a supabase provider. Some of the repos I have seen add a supabase provider to their layout.tsx and I was wondering if that was common practice and where in the documentation it talks about that. Thanks!
Was this page helpful?