diff --git a/src/providers/nextAuthAuthentication/provider.tsx b/src/providers/nextAuthAuthentication/provider.tsx index 3f37ab31..52b1e120 100644 --- a/src/providers/nextAuthAuthentication/provider.tsx +++ b/src/providers/nextAuthAuthentication/provider.tsx @@ -13,6 +13,7 @@ import { NextAuthAuthenticationProviderProps } from "./types"; export function NextAuthAuthenticationProvider({ children, + refetchInterval = 0, session, timeout, }: NextAuthAuthenticationProviderProps): JSX.Element { @@ -23,6 +24,7 @@ export function NextAuthAuthenticationProvider({ const { isAuthenticated } = authState; const { callbackUrl } = useSessionCallbackUrl(); useSessionIdleTimer({ + crossTab: true, disabled: !isAuthenticated, onIdle: () => { service.requestLogout({ callbackUrl, redirect: true }); @@ -31,7 +33,7 @@ export function NextAuthAuthenticationProvider({ }); useSessionAuth({ authReducer, authenticationReducer }); return ( - + {children} diff --git a/src/providers/nextAuthAuthentication/types.ts b/src/providers/nextAuthAuthentication/types.ts index 0351e7fb..02239de5 100644 --- a/src/providers/nextAuthAuthentication/types.ts +++ b/src/providers/nextAuthAuthentication/types.ts @@ -3,6 +3,7 @@ import { ReactNode } from "react"; export interface NextAuthAuthenticationProviderProps { children: ReactNode | ReactNode[]; + refetchInterval?: number; session?: Session | null; timeout?: number; }