Skip to content

Commit

Permalink
Merge pull request #17141 from Expensify/cristi_fix-magic-link-on-mob…
Browse files Browse the repository at this point in the history
…ile-native

Fix automatic authentication with magic link on mobile native

(cherry picked from commit 58b2bbb)
  • Loading branch information
jasperhuangg authored and OSBotify committed Apr 7, 2023
1 parent 0d5ed8d commit 1ada400
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as NetworkStore from '../../Network/NetworkStore';
import * as Report from '../Report';
import DateUtils from '../../DateUtils';
import Navigation from '../../Navigation/Navigation';
import ROUTES from '../../../ROUTES';

let credentials = {};
Onyx.connect({
Expand Down Expand Up @@ -402,6 +403,11 @@ function signInWithValidateCode(accountID, validateCode, twoFactorAuthCode) {
}, {optimisticData, successData, failureData});
}

function signInWithValidateCodeAndNavigate(accountID, validateCode, twoFactorAuthCode) {
signInWithValidateCode(accountID, validateCode, twoFactorAuthCode);
Navigation.navigate(ROUTES.HOME);
}

/**
* Initializes the state of the automatic authentication when the user clicks on a magic link.
*
Expand Down Expand Up @@ -641,6 +647,7 @@ export {
updatePasswordAndSignin,
signIn,
signInWithValidateCode,
signInWithValidateCodeAndNavigate,
initAutoAuthState,
signInWithShortLivedAuthToken,
cleanupSession,
Expand Down

0 comments on commit 1ada400

Please sign in to comment.