From 1238421d1612a5f62901b4679d74a46236e05e6e Mon Sep 17 00:00:00 2001 From: ManojNB Date: Wed, 21 Aug 2024 15:47:51 -0700 Subject: [PATCH] chore: minor reverts --- packages/auth/src/providers/cognito/apis/signOut.ts | 4 ++-- .../cognito/utils/oauth/handleOAuthSignOut.native.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/auth/src/providers/cognito/apis/signOut.ts b/packages/auth/src/providers/cognito/apis/signOut.ts index e5866537d77..4907edb579c 100644 --- a/packages/auth/src/providers/cognito/apis/signOut.ts +++ b/packages/auth/src/providers/cognito/apis/signOut.ts @@ -63,7 +63,7 @@ export async function signOut(input?: SignOutInput): Promise { if (hasOAuthConfig) { const oAuthStore = new DefaultOAuthStore(defaultStorage); oAuthStore.setAuthConfig(cognitoConfig); - const { type, error } = + const { type } = (await handleOAuthSignOut( cognitoConfig, oAuthStore, @@ -73,7 +73,7 @@ export async function signOut(input?: SignOutInput): Promise { if (type === 'error') { throw new AuthError({ name: OAUTH_SIGNOUT_EXCEPTION, - message: `An error occurred when attempting to log out from OAuth provider. ${error}`, + message: `An error occurred when attempting to log out from OAuth provider.`, }); } } else { diff --git a/packages/auth/src/providers/cognito/utils/oauth/handleOAuthSignOut.native.ts b/packages/auth/src/providers/cognito/utils/oauth/handleOAuthSignOut.native.ts index c6c99d5938c..c5efcd98ad3 100644 --- a/packages/auth/src/providers/cognito/utils/oauth/handleOAuthSignOut.native.ts +++ b/packages/auth/src/providers/cognito/utils/oauth/handleOAuthSignOut.native.ts @@ -5,6 +5,7 @@ import { CognitoUserPoolConfig } from '@aws-amplify/core'; import { OpenAuthSessionResult } from '../../../../utils/types'; import { DefaultOAuthStore } from '../../utils/signInWithRedirectStore'; +import { TokenOrchestrator } from '../../tokenProvider'; import { completeOAuthSignOut } from './completeOAuthSignOut'; import { oAuthSignOutRedirect } from './oAuthSignOutRedirect'; @@ -12,6 +13,8 @@ import { oAuthSignOutRedirect } from './oAuthSignOutRedirect'; export const handleOAuthSignOut = async ( cognitoConfig: CognitoUserPoolConfig, store: DefaultOAuthStore, + // No-op in here as it's only used in the non-native implementation + tokenOrchestrator: TokenOrchestrator, preferredSignOutUrl?: string, ): Promise => { const { isOAuthSignIn, preferPrivateSession } = await store.loadOAuthSignIn();