Replies: 2 comments
-
It does seem like there is an infinite loop somehow in my dashboard route, I added a comment in |
Beta Was this translation helpful? Give feedback.
0 replies
-
From what I can see here, it looks like a Supabase caller is being infinitely called/rendered. See this example repository which has Supabase Authentication set up with the OAuth2+OIDC flow. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Vite React app which is using Supabase and Google OAuth for authentication. I have an AuthContext to keep track of authentication state. It has the following type:
It makes network calls to supabase to get the authentication state and sets that in the context and returns it as a
useAuth
hook. I set up mymain.tsx
following the TanStack Router Authenticate Routes doc.main.tsx
I am trying to use my
useAuth
hook in my__root.tsx
to check if the user is authenticated since for logged in users I would like to show a different Navbar. I have it set up as:routes/__root.tsx
And I also have a dashboard route with is an authenticated route, if the user is not authenticated I redirect them to the
/login
route.routes/dashboard.tsx
pages/DashboardPage.tsx
However, when I try to refresh the page on my Dashboard route, I seem to get a memory leak error:
I feel like this is not the right way to achieve this?
I feel like I created some sort of infinite loop, but not sure where it is.
Beta Was this translation helpful? Give feedback.
All reactions