File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { NHSNotifySkipLink } from '@atoms/NHSNotifySkipLink/NHSNotifySkipLink';
88import { NhsNotifyHeader } from '@molecules/Header/Header' ;
99import { NHSNotifyContainer } from '@layouts/container/container' ;
1010import { NHSNotifyFooter } from '@molecules/Footer/Footer' ;
11+ import { LogoutWarningModal } from '@molecules/LogoutWarningModal/LogoutWarningModal' ;
1112
1213// https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadata-object
1314export const metadata : Metadata = {
@@ -40,6 +41,13 @@ export const metadata: Metadata = {
4041
4142export const dynamic = 'force-dynamic' ;
4243
44+ const config = {
45+ logoutInSeconds :
46+ Number ( process . env . NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS ) || 900 , // 15 minutes force logout
47+ promptTimeSeconds :
48+ Number ( process . env . NEXT_PUBLIC_PROMPT_SECONDS_BEFORE_LOGOUT ) || 120 , // 2 minutes before logout
49+ } ;
50+
4351export default function RootLayout ( {
4452 children,
4553} : {
@@ -63,6 +71,10 @@ export default function RootLayout({
6371 < NhsNotifyHeader />
6472 < NHSNotifyContainer > { children } </ NHSNotifyContainer >
6573 < NHSNotifyFooter />
74+ < LogoutWarningModal
75+ logoutInSeconds = { config . logoutInSeconds }
76+ promptBeforeLogoutSeconds = { config . promptTimeSeconds }
77+ />
6678 </ AuthProvider >
6779 </ CookiesProvider >
6880 </ body >
You can’t perform that action at this time.
0 commit comments