mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 23:56:37 +08:00
oauth
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
"use client"
|
||||
|
||||
import { useUser } from "@/contexts/user-context"
|
||||
|
||||
/**
|
||||
* Auth provider bridge hook
|
||||
*
|
||||
* Provides a stable interface for components that use the useAuth() pattern.
|
||||
* Delegates to the canonical UserContext under the hood.
|
||||
*/
|
||||
export function useAuth() {
|
||||
return useUser()
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use client"
|
||||
|
||||
import {QueryClient, QueryClientProvider} from "@tanstack/react-query"
|
||||
import {useState} from "react"
|
||||
|
||||
export function AppQueryProvider({ children }: { children: React.ReactNode }) {
|
||||
const [queryClient] = useState(
|
||||
() =>
|
||||
new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 30_000,
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 1,
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user