Skip to content

Commit

Permalink
chore: minor reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
Samaritan1011001 committed Aug 21, 2024
1 parent a0a6644 commit 1238421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/auth/src/providers/cognito/apis/signOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function signOut(input?: SignOutInput): Promise<void> {
if (hasOAuthConfig) {
const oAuthStore = new DefaultOAuthStore(defaultStorage);
oAuthStore.setAuthConfig(cognitoConfig);
const { type, error } =
const { type } =
(await handleOAuthSignOut(
cognitoConfig,
oAuthStore,
Expand All @@ -73,7 +73,7 @@ export async function signOut(input?: SignOutInput): Promise<void> {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ 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';

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<void | OpenAuthSessionResult> => {
const { isOAuthSignIn, preferPrivateSession } = await store.loadOAuthSignIn();
Expand Down

0 comments on commit 1238421

Please sign in to comment.