How to keep the same userId when linking anonymous and social accounts?
Hello.
I opened this issue earlier: https://github.com/better-auth/better-auth/issues/4180
I’d like to confirm the recommended approach for handling anonymous → social account linking without changing the userId:
If I set
Thanks in advance!
I opened this issue earlier: https://github.com/better-auth/better-auth/issues/4180
I’d like to confirm the recommended approach for handling anonymous → social account linking without changing the userId:
If I set
disableDeleteAnonymousUser: true, is it valid to:- Let Better Auth create the new
record when the social provider is linkeduser - In
onLinkAccount, reassign the newAccount.userIdto the existing anonymous user - Then delete the newly created
record, so that only the anonymous user remains as the main useruser
Thanks in advance!
GitHub
Hello, I’m currently working on handling data migration when linking an anonymous user account to a social login with onLinkAccount. My question: Is it possible to keep using the old anonymous user...