mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-10-29 02:33:08 +00:00
refactor: enhance authentication and signup flow with new providers, update middleware matcher, and improve type safety for API responses
This commit is contained in:
13
providers/AuthProvider.tsx
Normal file
13
providers/AuthProvider.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
"use client"
|
||||
|
||||
import type { Session } from "next-auth"
|
||||
import { SessionProvider } from "next-auth/react"
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode
|
||||
session?: Session
|
||||
}
|
||||
|
||||
export const AuthProvider = ({ children, session }: Props) => {
|
||||
return <SessionProvider session={session}>{children}</SessionProvider>
|
||||
}
|
||||
12
providers/query-provider.tsx
Normal file
12
providers/query-provider.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
"use client";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
export default function QueryProvider({
|
||||
children,
|
||||
}: { children: React.ReactNode }) {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
10
providers/theme-provider.tsx
Normal file
10
providers/theme-provider.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
|
||||
export function ThemeProvider({
|
||||
children,
|
||||
...props
|
||||
}: React.ComponentProps<typeof NextThemesProvider>) {
|
||||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user