-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Deprecate requiresTwoFactorAuth
property
#7864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we auto-focus the 2fa input? It feels tedious to have to click after you thought you were already signed in. If you don't want to do it yourself, it would probably be an easy contributor task too
@@ -250,6 +249,10 @@ function signIn(password, twoFactorAuthCode) { | |||
createTemporaryLogin(authToken, email); | |||
}) | |||
.catch((error) => { | |||
if (error.message === 'passwordForm.error.twoFactorAuthenticationEnabled') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this. Where is error.message
coming from? How could it equal `'passwordForm.error.twoFactorAuthenticationEnabled'??
Also, we should not base logic on error messages, we should use the jsonCodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where we're throw the error if we receive a 402 json code when authenticating. Maybe it would be better to return the response in API.js here if the json code is 402 and then change the logic here to:
if (error.message === 'passwordForm.error.twoFactorAuthenticationEnabled') { | |
if (response.jsonCode === 402) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we use both as in here
We should check for the json code first, and then if the specific mesage is important then check against it as well, the message should be a constant though, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sketchydroide that link is broken, can you re-share it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is the correct link?
if (response.jsonCode === 402) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. Kind of odd we do that... I guess since it is repeating the pattern this is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was some weird fuckery on the link, I've fixed it
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @francoisl in version: 1.1.41-6 🚀
|
Details
Remove usage of the
requiresTwoFactorAuth
property from the response ofGetAccountStatus
request. This will be removed from the API. Related Web PR: https://github.com/Expensify/Web-Expensify/pull/33141Fixed Issues
$ https://github.com/Expensify/Expensify/issues/193728
Tests
Tested with https://github.com/Expensify/Web-Expensify/pull/33141
Account set up with 2FA
Account not set up with 2FA
QA Steps
Account set up with 2FA
Account not set up with 2FA
Tested On
Screenshots
Web
Desktop