From 03349b55278d432eefbdac131a35fa8da5e05304 Mon Sep 17 00:00:00 2001 From: John Hagerman Date: Tue, 3 Dec 2024 13:26:02 -0500 Subject: [PATCH 1/2] fix/2fa-redirect: fix redirect to v5 for 2fa reset --- .../blockchain-wallet-v4-frontend/src/scenes/app.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx index 97b4370438f..54ecefaa6b2 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx @@ -125,7 +125,9 @@ const useFullPathForRedirect = [ '/wallet/import-wallet', '/#/signup', '/#/help-exchange/', - 'help-exchange' + 'help-exchange', + '/#/reset-2fa', + '/reset-2fa.' ] const excludedProduction = [ @@ -183,7 +185,7 @@ const App = ({ const optOutDateThreshold = new Date('2024-11-25T00:00:00.000Z') // cutoff date any user with reversion date before this will go to v5 Nov 22nd 2024 const isOptOutDateAfterDateThreshold = optOutDataAsDateObject > optOutDateThreshold // if user's reversion date is after cutoff this is true, they will stay on v4 - //if opted out and no opt out date add one + // if opted out and no opt out date add one if (optOut && optOutDate === null) localStorage.setItem('opt_out_date', new Date().toISOString()) @@ -232,7 +234,6 @@ const App = ({ '[ROUTING_DEBUG]: User has opted out of v5, and their opt out date is after the threshold, staying on v4' ) setDynamicRoutingState(false) - return } else { const redirectUrl = removeHash(fullPath) if (optOut) localStorage.removeItem('opt_out_wallet_v5_ui') // go ahead remove opt_out key @@ -250,8 +251,6 @@ const App = ({ console.log('xx', window?.WALLET_V5_LINK, 'not using full path for redirect') window.location.href = window?.WALLET_V5_LINK } - - return } }, []) From 7c16a5ceabed758ce87712f73d51973944e481b4 Mon Sep 17 00:00:00 2001 From: jhagerman-bc <96084682+jhagerman-bc@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:27:54 -0500 Subject: [PATCH 2/2] Update app.tsx --- packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx index 54ecefaa6b2..9755a4a4db4 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx @@ -234,6 +234,7 @@ const App = ({ '[ROUTING_DEBUG]: User has opted out of v5, and their opt out date is after the threshold, staying on v4' ) setDynamicRoutingState(false) + return } else { const redirectUrl = removeHash(fullPath) if (optOut) localStorage.removeItem('opt_out_wallet_v5_ui') // go ahead remove opt_out key @@ -251,6 +252,8 @@ const App = ({ console.log('xx', window?.WALLET_V5_LINK, 'not using full path for redirect') window.location.href = window?.WALLET_V5_LINK } + + return } }, [])