feat(auth): wire AuthProvider around app providers and mirror token to sessionStorage
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// src/app/providers.tsx
|
||||
import { type PropsWithChildren, useState } from 'react'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { AuthProvider } from 'auth/AuthProvider'
|
||||
|
||||
export function AppProviders({ children }: PropsWithChildren) {
|
||||
const [client] = useState(
|
||||
@ -9,5 +10,9 @@ export function AppProviders({ children }: PropsWithChildren) {
|
||||
defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1 } },
|
||||
})
|
||||
)
|
||||
return <QueryClientProvider client={client}>{children}</QueryClientProvider>
|
||||
return (
|
||||
<AuthProvider>
|
||||
<QueryClientProvider client={client}>{children}</QueryClientProvider>
|
||||
</AuthProvider>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user