Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve signin with magic link #17979

Merged
merged 6 commits into from
Apr 26, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,16 @@ function signIn(password, validateCode, twoFactorAuthCode, preferredLocale = CON
API.write('SigninUser', params, {optimisticData, successData, failureData});
}

function signInWithValidateCode(accountID, validateCode, twoFactorAuthCode) {
function signInWithValidateCode(accountID, code, twoFactorAuthCode) {
// If this is called from the 2fa step, get the validateCode directly from onyx
// instead of the one passed from the component state because the state is changing when this method is called.
let validateCode;
if (twoFactorAuthCode) {
validateCode = credentials.validateCode;
} else {
validateCode = code;
}
cristipaval marked this conversation as resolved.
Show resolved Hide resolved

const optimisticData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
Expand Down