feat(shared): update db schema, i18n messages, rate-limit, auth-session-provider
- Update src/shared/db/schema.ts - Update i18n messages for en and zh-CN (error-book, exam-homework, leave, lesson-preparation, notifications, rbac, student, textbooks, diagnostic) - Update src/shared/lib/rate-limit/index.ts and redis-limiter.ts - Update src/shared/components/auth-session-provider.tsx
This commit is contained in:
@@ -2,10 +2,17 @@
|
||||
|
||||
import * as React from "react"
|
||||
import { SessionProvider } from "next-auth/react"
|
||||
import type { Session } from "next-auth"
|
||||
|
||||
export function AuthSessionProvider({ children }: { children: React.ReactNode }) {
|
||||
interface AuthSessionProviderProps {
|
||||
children: React.ReactNode
|
||||
/** SSR 期间获取的 session,避免 client 端异步获取导致的 hydration mismatch */
|
||||
session?: Session | null
|
||||
}
|
||||
|
||||
export function AuthSessionProvider({ children, session }: AuthSessionProviderProps) {
|
||||
return (
|
||||
<SessionProvider refetchOnWindowFocus={false} refetchInterval={0}>
|
||||
<SessionProvider session={session} refetchOnWindowFocus={false} refetchInterval={0}>
|
||||
{children}
|
||||
</SessionProvider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user