making auto linking optional #4643
Replies: 1 comment
-
i would like to give an example of when this feature would be helpful. |
Beta Was this translation helpful? Give feedback.
-
i would like to give an example of when this feature would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Description 📓
as mentioned in the documentation:
With automatic account linking on sign in, this can be exploited by bad actors to hijack accounts by creating an OAuth account associated with the email address of another user.
but i think it would be awesome if it's optional.
this is how i added the auto linking in the callback handler
const userByEmail = profile.email ? await getUserByEmail(profile.email) : null; if (!userByEmail) { const newUser = { ...profile, emailVerified: null }; delete newUser.id; user = await createUser(newUser); await ((_events$createUser2 = events.createUser) === null || _events$createUser2 === void 0 ? void 0 : _events$createUser2.call(events, { user, })); } user = userByEmail;
in this feature request i want to make it optional.
How to reproduce ☕️
having user table. but not account table in the db for a user.
Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
Beta Was this translation helpful? Give feedback.
All reactions