Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix useAutoAuthRedirect queryClient

Alaister Youngb98e437270d4
diff --git a/studio/hooks/misc/useAutoAuthRedirect.tsx b/studio/hooks/misc/useAutoAuthRedirect.tsx
index 056db53ef22..3a63cae6976 100644
--- a/studio/hooks/misc/useAutoAuthRedirect.tsx
+++ b/studio/hooks/misc/useAutoAuthRedirect.tsx
@@ -1,4 +1,4 @@
-import { useQueryClient } from '@tanstack/react-query'
+import { QueryClient } from '@tanstack/react-query'
import { auth, getReturnToPath } from 'lib/gotrue'
import { useRouter } from 'next/router'
import { useCallback, useEffect } from 'react'
@@ -47,9 +47,8 @@ export function usePushNext() {
)
}
-function useAutoAuthRedirect() {
+function useAutoAuthRedirect(queryClient: QueryClient) {
const pushNext = usePushNext()
- const queryClient = useQueryClient()
useEffect(() => {
const searchParams = new URLSearchParams(location.search)
diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsx
index e77baa71827..ecd9fb09b91 100644
--- a/studio/pages/_app.tsx
+++ b/studio/pages/_app.tsx
@@ -96,7 +96,7 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
- useAutoAuthRedirect()
+ useAutoAuthRedirect(queryClient)
const getLayout = Component.getLayout ?? ((page) => page)