-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Passwordless - Web automatic login #14443
Conversation
…sFlow' into cristi_passwordless-auto-login
…sFlow' into cristi_passwordless-auto-login
da56773
@aimane-chnaif Yes, they are correct. |
I also think all scenarios are correct except last step of Scenario 2. |
When you refresh the page, you are in the Scenario 1, with chrome signed in already. So it is correct to see the page as in scenario 1. |
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.
👍
|
||
// Disable deep linking in desktop App when passwordless is enabled because | ||
// we want to open the magic link in its own tab | ||
isDisabled: betas => Permissions.canUsePasswordlessLogins(betas), |
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.
If passwordless enabled, desktop deep link is disabled completely throughout the app. I think we should disable this only when deep link is magic code link
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.
The magic link
looks the same as the link used to validate login
, which is going to be removed when Passwordless is fully rolled out in production. For now, we still want validate login
to work in production for the users who don't have Passwordless beta enabled.
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.
Or according to new logic, isn't it fine to open desktop app with magic link?
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.
It's fine to open the desktop App when Passwordless beta is not enabled, and a new account is created. The user clicks the link to validate the newly created account and this link looks exactly the same as the magic link. This is a temporary thing, because validate login
will be removed when Passwordless is fully rolled out in ptoduction.
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.
The
magic link
looks the same as the link used tovalidate login
, which is going to be removed when Passwordless is fully rolled out in production. For now, we still wantvalidate login
to work in production for the users who don't have Passwordless beta enabled.
i.e. when open user profile link, it should still show open desktop popup. this is current behavior in production
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.
Or according to new logic, isn't it fine to open desktop app with magic link?
Oh, I think I missed your question. Yes, it is desired to NOT have deep linking enabled when there's is the magic code
flow, but we want the old flow (validate login
) to stay unchanged, with deep linking enabled.
@cristipaval please check this video. I believe this PR should not disable any other deep link for desktop app. Or you meant to revert disabling deeplink once passwordless is fully rolled out on production? deep.link.mov |
As we discussed 1:1
|
ok, resolved above concern in private discussion with @cristipaval |
posted here our conclusion for future reference |
Reviewer Checklist
Screenshots/VideosWebPasswordless beta disabled: web-password1.movweb-password2.movPasswordless beta enabled: web-passwordless1.movweb-passwordless2.movMobile Web - ChromeMobile Web - Safarimsafari.mp4DesktopiOSAndroid |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.2.72-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.2.72-1 🚀
|
/** | ||
* @returns {String} | ||
*/ | ||
accountID = () => lodashGet(this.props.route.params, 'accountID', ''); |
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.
Typically, it is recommended to prefix functions that retrieve information with "get", so perhaps we could consider renaming accountID()
and validateCode()
to getAccountID()
and getValidateCode()
respectively?
Additionally, I could be out of the loop on our style guide, but I think we have not yet adopted instance class properties.
I understand it is less verbose than having to declare things in the constructor and people are often confused about this
in React class components - but can we update to be more consistent with the current styles?
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.
Hey @marcaaron ! Thanks for guiding me on following the style! I am working on a follow up PR which touches this class. It should be ready for review. I am adding your suggestions in the new PR.
// This is temporary for now. Server should login with the accountID and validateCode | ||
API.write('SigninUser', { | ||
validateCode, | ||
accountID, |
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.
beep boop 🤖 🐧
dropping a friendly note that we missed an edge case - Device language preference does not persist when authenticating with magic link.
Because we didn't write the preferred local to the server.
Details
Adds automatic login on web when clicking on the link with the magic code.
Fixed Issues
https://github.com/Expensify/Expensify/issues/249362
Tests
Passwordless beta flag enabled (default in dev environment)
src/libs/Permissions.js
and make the functioncanUsePasswordlessLogins
havereturn true;
Passwordless beta flag disabled
src/libs/Permissions.js
and make the functioncanUsePasswordlessLogins
havereturn false;
lib/BetaManager.php
and make sure$allBetasEnabled
is set tofalse
Offline tests
N/A
QA Steps
NOTE: (Steps 8-12 from Tests section can't be QAed before rolling Passwordless to production, because we can't get
betas
for anaccountID
from server).PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Passwordless enabled:Screen.Recording.2023-02-09.at.16.13.22.mov
Passwordless disabled:
web.np.mov
Mobile Web - Chrome
Passwordless enabled:Screen.Recording.2023-02-09.at.16.28.26.mov
Passwordless disabled:
android.chrome.np.mov
Mobile Web - Safari
Passwordless enabled:Screen.Recording.2023-02-09.at.16.19.04.mov
Passwordless disabled:
ios.safari.np.mov
Desktop
N/A
iOS
N/A
Android
N/A