From bf10a6d70487f2310ee2ca4cf8bb975a0664e5e0 Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Mon, 2 Dec 2024 22:46:36 +0100 Subject: [PATCH] :bug: workaround user already signed in refs https://github.com/aws-amplify/amplify-js/issues/13813 --- src/library.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/library.ts b/src/library.ts index 68f97b2..e3c786d 100644 --- a/src/library.ts +++ b/src/library.ts @@ -18,6 +18,9 @@ const headers = (jwtToken: string) => ({ Authorization: `Bearer ${jwtToken}` }); * Sign in to return the JWT token. */ const signIn = async (username: string, password: string): Promise => { + // in case the user is already signed in, refs: + // https://github.com/aws-amplify/amplify-js/issues/13813 + await amplifyAuth.signOut(); const { isSignedIn, nextStep } = await amplifyAuth.signIn({ username, password,