File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1+ import { useEffect } from 'react'
2+
13import { declareComponentKeys } from 'i18nifty'
24
5+ import { executePreLogoutActions } from '@/hooks/prelogout'
36import { useTranslation } from '@/i18n'
47import { useOidc } from '@/oidc'
58
69export function AutoLogoutCountdown ( ) {
710 const { t } = useTranslation ( { AutoLogoutCountdown } )
811 const { autoLogoutState } = useOidc ( )
912
13+ useEffect ( ( ) => {
14+ if ( autoLogoutState . shouldDisplayWarning ) {
15+ ; ( async ( ) => {
16+ await executePreLogoutActions ( )
17+ } ) ( )
18+ }
19+ } , [ autoLogoutState . shouldDisplayWarning ] )
20+
1021 if ( ! autoLogoutState . shouldDisplayWarning ) {
1122 return null
1223 }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ bootstrapOidc(
3131 autoLogoutParams : autoLogoutParams ,
3232 // Enable for detailed initialization and token lifecycle logs.
3333 debugLogs : true ,
34+ warnUserSecondsBeforeAutoLogout : 60 ,
3435 }
3536 : {
3637 // Mock mode: no requests to an auth server are made.
You can’t perform that action at this time.
0 commit comments