@@ -15,6 +15,7 @@ import { useCallbackOnce } from '../../lib/hooks';
1515import { apiFetchAccountStatus } from '../../lib/apiClient' ;
1616import { CheckoutType } from 'fxa-shared/subscriptions/types' ;
1717import { metadataFromPlan } from 'fxa-shared/subscriptions/metadata' ;
18+ import { ACCESS_TOKEN_KEY } from '../..' ;
1819
1920const CHECKOUT_TYPE = CheckoutType . WITHOUT_ACCOUNT ;
2021const DEFAULT_NEWSLETTER_STRING_ID =
@@ -116,6 +117,8 @@ export const NewUserEmailForm = ({
116117 } , [ onFormEngaged ] ) ;
117118
118119 const onClickSignInButton = ( ) => {
120+ // Clear any remaining access token from a previous session
121+ localStorage . removeItem ( ACCESS_TOKEN_KEY )
119122 selectedPlan . other = 'click-signnin' ;
120123 Amplitude . createAccountSignIn ( {
121124 ...selectedPlan ,
@@ -289,7 +292,7 @@ export async function emailInputValidationAndAccountCheck(
289292
290293 const errorMsg = getString
291294 ? /* istanbul ignore next - not testing l10n here */
292- getString ( 'new-user-email-validate' )
295+ getString ( 'new-user-email-validate' )
293296 : 'Email is not valid' ;
294297
295298 const accountExistsMsg = (
@@ -355,7 +358,7 @@ export function emailConfirmationValidation(
355358
356359 const errorMsg = getString
357360 ? /* istanbul ignore next - not testing l10n here */
358- getString ( 'new-user-email-validate-confirm' )
361+ getString ( 'new-user-email-validate-confirm' )
359362 : 'Emails do not match' ;
360363
361364 return {
0 commit comments