Skip to content

Commit d7bc743

Browse files
committed
CCM-8744: sync global signout
1 parent 28e0055 commit d7bc743

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/app/auth/signout/page.dev.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
import React, { Suspense, useEffect } from 'react';
44
import { useAuthenticator } from '@aws-amplify/ui-react';
5+
import { signOut } from 'aws-amplify/auth';
56
import JsCookie from 'js-cookie';
67
import { NHSNotifyMain } from '@atoms/NHSNotifyMain/NHSNotifyMain';
78

89
export const SignOut = ({ children }: { children: React.ReactNode }) => {
9-
const { signOut, authStatus } = useAuthenticator((ctx) => [ctx.authStatus]);
10+
const { authStatus } = useAuthenticator((ctx) => [ctx.authStatus]);
1011

1112
useEffect(() => {
1213
if (authStatus === 'authenticated') {
1314
signOut({ global: true });
1415
JsCookie.remove('csrf_token');
1516
}
16-
}, [authStatus, signOut]);
17+
}, [authStatus]);
1718

1819
return (
1920
<NHSNotifyMain>

0 commit comments

Comments
 (0)