next-auth
next-auth copied to clipboard
feat: Add a `linkAccountOverride` method in adapter
☕️ Reasoning
This allows to better control the authentication flow.
Effectively, it exposes a linkAccountOverride
method in the adapter.
This method will be triggered through this workflow:
- a user A is created through signing in with account A
- a user B is created through signing in with account B
- connected with account A (and user A), signing in with account B
Actual behaviour:
- sends back an error saying it is not possible to link an account already linked to a different user
Expected behaviour:
- Allow to customise what we want to do in this situation
What this PR offers:
- a method to control what to do in this situation, potentially allowing to link account B to user A
🧢 Checklist
- [ ] Documentation
- [ ] Tests
- [ ] Ready to be merged
🎫 Affected issues
Fixes: https://github.com/nextauthjs/next-auth/issues/9339
📌 Resources
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
auth-docs | ❌ Failed (Inspect) | Feb 12, 2024 5:17pm |
1 Ignored Deployment
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
next-auth-docs | ⬜️ Ignored (Inspect) | Visit Preview | Feb 12, 2024 5:17pm |
@Khaaz is attempting to deploy a commit to the authjs Team on Vercel.
A member of the Team first needs to authorize it.
I'll gladly add tests or docs, please let me know if this feature is acceptable first.
I would also love quick guidance on documentation or tests if possible (I'll try to figure it out anyway after confirmation this PR has a future).
Looking forward to any feedback as I definitely need this feature for my usecase.
Thanks a lot.