-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38142 from ikevin127/fix/34177
Desktop - Login - Unable to enter the 2FA code or exit the screen
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import CONST from '@src/CONST'; | ||
import type {AutoAuthState} from '@src/types/onyx/Session'; | ||
|
||
function desktopLoginRedirect(autoAuthState: AutoAuthState, isSignedIn: boolean) { | ||
// NOT_STARTED - covers edge case of autoAuthState not being initialized yet (after logout) | ||
// JUST_SIGNED_IN - confirms passing the magic code step -> we're either logged-in or shown 2FA screen | ||
// !isSignedIn - confirms we're not signed-in yet as there's possible one last step (2FA validation) | ||
const shouldPopToTop = (autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED || autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN) && !isSignedIn; | ||
|
||
if (shouldPopToTop) { | ||
Navigation.isNavigationReady().then(() => Navigation.resetToHome()); | ||
} | ||
} | ||
|
||
export default desktopLoginRedirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type {AutoAuthState} from '@src/types/onyx/Session'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function desktopLoginRedirect(autoAuthState: AutoAuthState, isSignedIn: boolean) {} | ||
export default desktopLoginRedirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters