- Introduce `AuthWrapper` component for streamlined session-based layouts and authentication handling. - Add new utilities (`tokenUtils.ts`) for JWT decoding, token expiration checks, and refresh operations via Keycloak. - Refactor `serverCall` and `authOptions` to use centralized token refresh logic, removing redundant implementations. - Implement `ClientSessionProvider` for consistent session management across the client application. - Simplify `RootLayout` by delegating authentication enforcement to `AuthWrapper`.
13 lines
285 B
TypeScript
13 lines
285 B
TypeScript
"use client";
|
|
|
|
import {SessionProvider} from "next-auth/react";
|
|
import React from "react";
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function ClientSessionProvider({children}: Props) {
|
|
return <SessionProvider refetchInterval={180}>{children}</SessionProvider>;
|
|
}
|