how can i prevent discord auth to automatically create new accounts?
basically i want the user to be able to sign in with discord only after he linked his discord account
Solution:Jump to solution
haven't tried it but seems like you just set it to false and it does what you want
15 Replies
tried doing this
but it doesn't work
Isn't signing up with discord technically linking their discord account?
so here's what i want to do
can't you just make it when they signup with discord that discord is then "linked" however you define that to their account whether that be storing something in the database
the user can opt to login with discord or email:pass
but in order to login with discord
they have to link it first
cuz i want to have all base accounts as credentials
i want to disallow discord sign ups that's the thing
and for some reasons
this is creating a new user account
if betterauth doesn't find any account with that discord id
OH

it seems that i had something cached in incognito??
ah maybe
or maybe your dev server didnt reload or something
no
still doesn't work
wtf
oh
i found an issue
if a user has his email the same with discord
it will link his account directly
tf
Yeah that's generally preferred for most sites
so they can login with either one as long as it's the same email
and is there any way
to disable that?
User & Accounts | Better Auth
User and account management.
yeah
ohhh
so i dont have to set that to true
Solution
haven't tried it but seems like you just set it to false and it does what you want