From 368d73e4c9e97f9c3e7da6ae5158838bf727d3c8 Mon Sep 17 00:00:00 2001 From: Mike Houston Date: Wed, 3 Jul 2024 11:14:08 +0100 Subject: [PATCH] CCM-5100: Use auth/signOut to avoid needing useAuthenticator hook --- components/Logout.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/Logout.tsx b/components/Logout.tsx index d8ec1d6..e0333c3 100644 --- a/components/Logout.tsx +++ b/components/Logout.tsx @@ -1,13 +1,12 @@ 'use client'; -import { useAuthenticator } from '@aws-amplify/ui-react'; import { Button } from 'nhsuk-react-components'; +import { signOut } from '@aws-amplify/auth'; export default function Logout() { - const { authStatus, signOut } = useAuthenticator(); async function handleSignOut() { - signOut(); + await signOut(); location.href = '/'; }