-
Notifications
You must be signed in to change notification settings - Fork 185
@W-17550783 - [Passwordless login] Redirect customer to page prior to login #2221
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
Merged
yunakim714
merged 22 commits into
feature-passwordless-social-login
from
W-17550783-passwordless-login-redirect
Feb 3, 2025
Merged
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
24c7a7b
add locatedfrom session item:
yunakim714 fb7c92f
lint
yunakim714 02fc981
use local storage
yunakim714 272405a
use localstorage
yunakim714 10a22c3
cleanup
yunakim714 c2a6941
login page s hould redirect to account
yunakim714 4b64139
remove item after reading
yunakim714 1d20200
check that setitem is being called when logging in with passwordless
yunakim714 a45ed60
test passwordless login in useauthmodal hook file
yunakim714 54436ac
add localstorage tests in login page
yunakim714 84ab168
redirect via query param on magic link
yunakim714 7051eec
cleanup
yunakim714 4e9945f
encode magic link
yunakim714 5b9deca
decode specific queryparams
yunakim714 b40e815
fix login page redirect
yunakim714 3dc0d43
only add redirect_uri if it is passed
yunakim714 b831c17
encode each query param separately
yunakim714 39876bd
add passwordless landing tests
yunakim714 b7b7d62
reset redirect path before navigating
yunakim714 e23bdce
reset redirectpath if no queryparam
yunakim714 73f6482
Passwordless redirect unit test (#2235)
hajinsuha1 cd1517c
Merge branch 'feature-passwordless-social-login' into W-17550783-pass…
yunakim714 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
What was the reason behind using localStorage? Can we use a query param to avoid having to handle this variable? Something like https://pwa-kit.storefront.com/login?token&1234&redirectTo=/checkout
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.
There are a few benefits of using query param than localStorage. One of which is it is not tied to a device. Imagine a shopper clicks login with link on a laptop, and then they check email and click on the magic link to logic. Can they resume their shopping from their?
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.
@alexvuong To send the
redirect_url
I would have to pass it in as part of the callbackURL param when calling the 1stauthorizePasswordless
API call so I thought this method would be more straightforward (though Blair did say that passing in the query params as part of the callback URL should be fine).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.
@yunakim714 Why would we need to pass it into the callbackURL ? 🤔
Uh oh!
There was an error while loading. Please reload this page.
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'd suggest we try the query param solution if possible since the localStorage can potential cause more bugs. There are some edge cases that will potentially disable the redirection. Say, what if users clear their storage before they click on the magic link? or when they use incognito browser?