From 32e35d49044d4d3770d358e8111dfb44f149f0f6 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Fri, 23 Feb 2024 17:16:16 +0100 Subject: [PATCH 1/5] Fix: Unable to return to home page when logging in via link with target path --- src/libs/actions/Session/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index f384e38f6d55..013d86049150 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -856,7 +856,7 @@ function handleExitToNavigation(exitTo: Routes | HybridAppRoute) { waitForUserSignIn().then(() => { Navigation.waitForProtectedRoutes().then(() => { const url = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo; - Navigation.navigate(url, CONST.NAVIGATION.TYPE.FORCED_UP); + Navigation.navigate(url); }); }); }); From aa2d94cbb210ce64ea90e1f9723194986c241508 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Fri, 23 Feb 2024 17:25:33 +0100 Subject: [PATCH 2/5] Fix: Native - Navigation to exitTo path not performed when the user is already signed in --- src/pages/ValidateLoginPage/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/ValidateLoginPage/index.tsx b/src/pages/ValidateLoginPage/index.tsx index edc8b61c82b0..e689ad7c3e30 100644 --- a/src/pages/ValidateLoginPage/index.tsx +++ b/src/pages/ValidateLoginPage/index.tsx @@ -19,6 +19,10 @@ function ValidateLoginPage({ if (session?.authToken) { // If already signed in, do not show the validate code if not on web, // because we don't want to block the user with the interstitial page. + if (exitTo){ + Session.handleExitToNavigation(exitTo); + return; + } Navigation.goBack(); } else { Session.signInWithValidateCodeAndNavigate(Number(accountID), validateCode, '', exitTo); From c93da9cd9b7f3defa24cdfb13d71906bb5b47362 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:25:56 +0100 Subject: [PATCH 3/5] Fix: magic code / abracadabra page appears for a moment before navigation --- src/pages/ValidateLoginPage/index.website.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 7ce46ee11b14..963c31e5b41a 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -64,8 +64,8 @@ function ValidateLoginPage({ <> {autoAuthState === CONST.AUTO_AUTH_STATE.FAILED && } {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && is2FARequired && !isSignedIn && } - {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && } - {autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && ( + {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && } + {autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo && ( Date: Fri, 23 Feb 2024 19:29:11 +0100 Subject: [PATCH 4/5] prettier --- src/pages/ValidateLoginPage/index.tsx | 2 +- src/pages/ValidateLoginPage/index.website.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/ValidateLoginPage/index.tsx b/src/pages/ValidateLoginPage/index.tsx index e689ad7c3e30..2289547afe56 100644 --- a/src/pages/ValidateLoginPage/index.tsx +++ b/src/pages/ValidateLoginPage/index.tsx @@ -19,7 +19,7 @@ function ValidateLoginPage({ if (session?.authToken) { // If already signed in, do not show the validate code if not on web, // because we don't want to block the user with the interstitial page. - if (exitTo){ + if (exitTo) { Session.handleExitToNavigation(exitTo); return; } diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 963c31e5b41a..326112684817 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -64,7 +64,7 @@ function ValidateLoginPage({ <> {autoAuthState === CONST.AUTO_AUTH_STATE.FAILED && } {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && is2FARequired && !isSignedIn && } - {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && } + {autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && } {autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo && ( Date: Fri, 23 Feb 2024 19:43:21 +0100 Subject: [PATCH 5/5] Fix: magic code page is displayed if we open the link in a separate browser, navigation was done after clicking just sign in here link --- src/pages/ValidateLoginPage/index.website.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 326112684817..866b061d964f 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -34,7 +34,7 @@ function ValidateLoginPage({ } Session.initAutoAuthState(autoAuthState); - if (isSignedIn || !login) { + if (isSignedIn || (!login && !exitTo)) { if (exitTo) { Session.handleExitToNavigation(exitTo); }