-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: add identity linking methods #814
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.
Looks good to me but leave requesting changes so this doesn't accidentally get merged - feel free to resolve whenever
🎉 This PR is included in version 2.60.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I think I've found a few issues with this, specifically using
@kangmingtay @J0 would you be able to help please? |
Hey @chhuang, Thanks for filing the issue and for your patience with us while we work through the tickets. Might need to trouble you for a bit of information. For:
As I understand the first steps would be:
Mind sharing more about the next step?
I am guessing here but would it be:
If you have a linked video that would be very helpful
I think
I'm spitballing and will need to check further but there might be a mismatch in the one of the fields of the JWT. If you see any differences that stand out let us know. Thanks! |
Thanks for looking into this @J0 Scenario 1 A (not working):
In the same scenario, User A can sign in with Twitter ( Scenario 1 B (working):
Scenario 2:
I think the UX can be improved for step 6? I can see this is in the TODO of this PR and it's checked, can you confirm it's working as intended please? Scenario 3:
Unlike the other scenarios, here the user is not logged out automatically. I can also unlink my Discord without problem. What is the reason I can't unlink my Twitter here? Since I've also added Discord, I should be able to unlink Twitter right? |
@@ -286,6 +286,15 @@ export default class GoTrueClient { | |||
if (error) { | |||
this._debug('#_initialize()', 'error detecting session from URL', error) | |||
|
|||
// hacky workaround to keep the existing session if there's an error returned from identity linking | |||
// TODO: once error codes are ready, we should match against it instead of the message | |||
if ( |
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 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 @chhuang,
Thanks for the detailed write up! Looking at this now
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.
@chhuang this is because the error is being appended as a query parameter in the redirect url but the http status code returned is 3xx and not a 4xx or 5xx
Hi @chhuang, thanks for providing all these details. Scenario 1 will be fixed by this PR. Scenario 2 is expected but you should not be logged out in step 6 - i'll look into why that's happening in the client library Scenario 3 happens because you already have another user / identity in your db that uses the email |
Thanks @kangmingtay for the fix! Can you tell me how to get the fix? Which library should I update? |
What kind of change does this PR introduce?
unlinkIdentity
,linkIdentity
,getUserIdentities
to support the new identity linking endpointsTODO