Fix: prevent signing in to wrong account in the desktop app via magic link#24207
Conversation
|
|
||
| function beginDeepLinkRedirect() { | ||
| // Match any magic link (/v/<account id>/<6 digit code>) | ||
| const isMagicLink = /\/v\/\w+\/[0-9]{6}/.test(window.location.pathname) |
There was a problem hiding this comment.
Can we use CONST.REGEX.ROUTES.VALIDATE_LOGIN?
Reviewer Checklist
Screenshots/VideosWeb + desktopdesktop3-compressed.mp4Mobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
Lost a couple comments when we moved that line, so @JKobrynski take a look at #24207 (comment) (though I don't know if we need to do that?). As for the |
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates wheather default authentication method (shortLivedAuthToken) should be used | ||
| */ | ||
| function beginDeepLinkRedirectAfterTransition(shouldAuthenticateWithCurrentAccount = true) { | ||
| waitForSignOnTransitionToFinish().then(beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount)); |
There was a problem hiding this comment.
| waitForSignOnTransitionToFinish().then(beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount)); | |
| waitForSignOnTransitionToFinish().then(() => beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount)); |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopdesktop.mp4iOSAndroid |
|
@JKobrynski Please complete the checklist (the author checklist) |
dangrous
left a comment
There was a problem hiding this comment.
Sorry one typo, then good to go!
| function beginDeepLinkRedirectAfterTransition() { | ||
| waitForSignOnTransitionToFinish().then(beginDeepLinkRedirect); | ||
| /** | ||
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates wheather default authentication method (shortLivedAuthToken) should be used |
There was a problem hiding this comment.
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates wheather default authentication method (shortLivedAuthToken) should be used | |
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates whether default authentication method (shortLivedAuthToken) should be used |
|
|
||
| function beginDeepLinkRedirect() { | ||
| /** | ||
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates wheather default authentication method (shortLivedAuthToken) should be used |
There was a problem hiding this comment.
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates wheather default authentication method (shortLivedAuthToken) should be used | |
| * @param {boolean} shouldAuthenticateWithCurrentAccount Optional, indicates whether default authentication method (shortLivedAuthToken) should be used |
|
Oh and please run And is there a way to sign your commits? I confess I don't fully know what that means haha; maybe @s77rt has an idea? |
|
@dangrous Signed commits are just to prove that you are the real person who made those commits as I think it's pretty easy to impersonate others. |
|
Addressed the newest comments, signed the latest commits |
|
Code looks good! It's still having trouble with some of the commits; is there a way to go back and sign these? The two you just pushed seem okay, but the ones before.
Looks like there are a couple resources online that explain how to do this. Sorry for the trouble! |
2e67fc2 to
08447b8
Compare
|
@dangrous commits have been signed! |
dangrous
left a comment
There was a problem hiding this comment.
Thank you for getting that sorted!
|
✋ 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/dangrous in version: 1.3.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
Details
Fixed Issues
$ #23409
PROPOSAL: #23409 (comment)
Tests
Disclaimer
This is a desktop only issue that is not reproductible on mobile, therefore there are no testing steps or screen recordings on mobile.
Offline tests
QA Steps
Same as "Tests" section above
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 + desktop
desktop3-compressed.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android