File tree Expand file tree Collapse file tree
packages/fxa-settings/src/components/Settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import { SETTINGS_PATH } from '../../constants';
3535import PageAvatar from './PageAvatar' ;
3636import PageRecentActivity from './PageRecentActivity' ;
3737import { MfaGuardPageRecoveryKeyCreate } from './PageRecoveryKeyCreate' ;
38- import { currentAccount , sessionToken } from '../../lib/cache' ;
38+ import { currentAccount , isSigningOut , sessionToken } from '../../lib/cache' ;
3939import { hasAccount , setCurrentAccount } from '../../lib/storage-utils' ;
4040import GleanMetrics from '../../lib/glean' ;
4141import Head from 'fxa-react/components/Head' ;
@@ -131,9 +131,12 @@ export const Settings = ({
131131
132132 // This error check includes a network error
133133 if ( error ) {
134- // If the session token is invalid (destroyed/expired), redirect to signin
134+ // If the session token is invalid, redirect to signin.
135+ // Skip during sign-out to avoid racing with window.location.assign.
135136 if ( error instanceof InvalidTokenError ) {
136- navigateWithQuery ( '/signin' ) ;
137+ if ( ! isSigningOut ( ) ) {
138+ navigateWithQuery ( '/signin' ) ;
139+ }
137140 return < LoadingSpinner fullScreen /> ;
138141 }
139142 Sentry . captureException ( error , { tags : { source : 'settings' } } ) ;
You can’t perform that action at this time.
0 commit comments