Skip to content

Commit 2688e92

Browse files
committed
fix(mfa): reject a flow start before the session account hydrates
1 parent 438a606 commit 2688e92

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/components/MultifactorAuthentication/Context/MultifactorAuthenticationMainContext.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ function MultifactorAuthenticationContextProvider({children}: MultifactorAuthent
6161
return;
6262
}
6363

64+
// The flow captures the account at INIT and keeps it for per-account device state, so a
65+
// session that has not hydrated yet must not start a flow keyed to the placeholder account.
66+
if (accountID === CONST.DEFAULT_NUMBER_ID) {
67+
addMFABreadcrumb('Flow rejected: account not initialized', {scenario: scenarioName}, 'warning');
68+
return;
69+
}
70+
6471
const startCredentialsState = await captureCredentialsState();
6572

6673
addMFABreadcrumb('Flow started', {

0 commit comments

Comments
 (0)