feat: add 2-factor authentication#18576
Conversation
|
Important notes / open questions:
|
Yes, we missed it. That sounds good 👍
I can get that for you!
I tried using different levels while writing the doc, but looks like 'Q' is closest to the proposed one. Do you think any other level is closest to the proposed one? If so, we can use that. 😄 |
|
Awesome, thanks @MonilBhavsar ! Here is a quick comparison between all QRCode levels: Personally, I find the |
|
L looks good to me 👍 |
|
@MonilBhavsar All new comments resolved, good catches! 👍🏻 Regarding clearing the Onyx data, since that page is now a functional component (following the effort to migrate away from Class Components) I disabled the
And here's the shield icon result:
|
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-05-17.at.3.28.05.PM.movMobile Web - ChromeScreen.Recording.2023-05-17.at.3.57.16.PM.movMobile Web - SafariScreen.Recording.2023-05-17.at.5.19.22.PM.movDesktopScreen.Recording.2023-05-17.at.3.30.55.PM.movAndroidScreen.Recording.2023-05-17.at.4.05.27.PM.mov |
MonilBhavsar
left a comment
There was a problem hiding this comment.
Great work @thiagobrez 👏
|
✋ 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 staging by https://github.com/MonilBhavsar in version: 1.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
2 similar comments
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
|
A minor regression caused due to height styles having less value - #19571 |
|
Just updating on another issue caused by this PR as part BZ checklist. |
|
Thanks for pointing out @abdulrahuman5196 . Will take more care next time 🚀 |
| twoFactorAuthCodesButton: { | ||
| minWidth: 100, | ||
| }, |
There was a problem hiding this comment.
The min width here was not enough and caused the copy button's width to change on click resulting in buttons jump behaviour #21566
| <Button | ||
| success | ||
| text={props.translate('common.next')} | ||
| isDisabled |
There was a problem hiding this comment.
✋ Coming from #20848
We want the button to be pressed like what we have for the sign-in page and maintain consistency between a similar flow.
| * @returns {string} | ||
| */ | ||
| function buildAuthenticatorUrl() { | ||
| return `otpauth://totp/Expensify:${props.account.primaryLogin}?secret=${props.account.twoFactorAuthSecretKey}&issuer=Expensify`; |
There was a problem hiding this comment.
Coming from #19366:
props.account.primaryLogin is not 100% value.
When user create new account, this value doesn't exist.
Instead, we replaced this with session.email which is stable value.








Details
Implementation of the 2-factor authentication flow, according to the design doc.
Fixed Issues
$ #18080
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
Enabling 2-FA flow:
Step 1: Recovery Codes
Step 2: Verify
Step 3: Finished
Disabling 2-FA flow:
Offline tests
QA Steps
Enabling 2-FA flow:
Step 1: Recovery Codes
Step 2: Verify
Step 3: Finished
Disabling 2-FA flow:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
safari.mov
Mobile Web - Chrome
android.web.mov
Mobile Web - Safari
ios.web.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mov