Pattern for overriding OAuthAccountNotLinked #3836
-
Question 💬Hello, I read your FAQ about "why are accounts not linked automatically", and understand the rationale for not doing so. Thanks for that writeup, it explained a lot! The writeup includes this line:
I'd like to trust callbacks: {
async signIn({ user, account, profile }) {
if (account.provider === 'google') {
const existingAccount = ...
if (existingAccount) {
// Allow login by Google if the Google account is already connected to a User
return true
}
const existingUser = ...
if (existingUser) {
// Allow login by Google if the Google email matches an existing User, and the
// email is verified by Google
return profile.email_verified
}
return false
}
},
}, However, this still throws the How to reproduce ☕️N/A Contributing 🙌🏽Yes, I am willing to help answer this question in a PR |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
FYI, I explained how I solved this problem (at least for my use case) in this comment: #230 (comment) |
Beta Was this translation helpful? Give feedback.
FYI, I explained how I solved this problem (at least for my use case) in this comment: #230 (comment)