Skip to content

Commit

Permalink
Replace cleanActiveSignInState
Browse files Browse the repository at this point in the history
  • Loading branch information
joon-won committed Dec 12, 2024
1 parent d0591b5 commit 79b179c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ import {
getNewDeviceMetadata,
getSignInResult,
} from '../../../providers/cognito/utils/signInHelpers';
import {
cleanActiveSignInState,
setActiveSignInState,
signInStore,
} from '../../../client/utils/store';
import { setActiveSignInState, signInStore } from '../../../client/utils/store';
import { AuthSignInOutput } from '../../../types';
import { getAuthUserAgentValue } from '../../../utils';
import { getPasskey } from '../../utils/passkey';
Expand Down Expand Up @@ -106,7 +102,7 @@ export async function handleWebAuthnSignInResult(
}),
signInDetails,
});
cleanActiveSignInState();
signInStore.dispatch({ type: 'RESET_STATE' });
await dispatchSignedInHubEvent();

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import {
} from '../types';
import {
autoSignInStore,
cleanActiveSignInState,
setActiveSignInState,
signInStore,
} from '../../../client/utils/store';
import { cacheCognitoTokens } from '../tokenProvider/cacheTokens';
import { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent';
Expand Down Expand Up @@ -111,7 +111,7 @@ export async function signInWithUserAuth(
}),
signInDetails,
});
cleanActiveSignInState();
signInStore.dispatch({ type: 'RESET_STATE' });

await dispatchSignedInHubEvent();

Expand All @@ -132,7 +132,7 @@ export async function signInWithUserAuth(
: undefined,
});
} catch (error) {
cleanActiveSignInState();
signInStore.dispatch({ type: 'RESET_STATE' });
resetAutoSignIn();
assertServiceError(error);
const result = getSignInResultFromError(error.name);
Expand Down

0 comments on commit 79b179c

Please sign in to comment.