Google Auth - merge identities
Hello! Is there a way to merge email/password identies with Google Auth?
So if someone made an email/password account but they want to also login via Google Auth? I don't see any easy way to merge this without having the user delete their account and then make one via Google Auth or?
3 Replies
Hi @A³Learn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Unfortunately, Wasp currently does not support merging multiple auth identities for a single user, such as combining email/password and Google Auth for the same account. This limitation is mentioned in several parts of the Wasp documentation.
According to the Auth Entities documentation:
"Wasp currently doesn't support multiple auth identities for a single user. This means, for example, that a user can't have both an email-based auth identity and a Google-based auth identity."
The same limitation is noted in the Email Authentication documentation and the Username & Password Authentication documentation.
However, there is good news. Wasp plans to add this functionality in the future with the introduction of an account merging feature. This feature is being tracked in a GitHub issue: Better user account merging logic.
For now, as you suggested, users would need to choose one authentication method. If they want to switch from email/password to Google Auth, they would indeed need to create a new account using Google Auth.
It's worth noting that this limitation is a result of recent changes in Wasp's auth system, as mentioned in the migration guide from 0.11.X to 0.12.X:
"The new auth system doesn't support multiple login methods per user at the moment. We do plan to add this soon though, with the introduction of the account merging feature."
So while it's not currently possible to merge identities, it's a feature that the Wasp team is aware of and planning to implement in the future.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @A³Learn, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
This is something we wanted to tackle for a long time: https://github.com/wasp-lang/wasp/issues/954
We want to expose some sort of a hook in which you can combine multiple accounts based on e.g.
email
GitHub
Better user account merging logic · Issue #954 · wasp-lang/wasp
Our existing lookup process just checks if we already associated a user to the incoming social auth method/id and creates a new user if there is no association: https://github.com/wasp-lang/wasp/bl...
For now without us supporting this feature... you could allow users to connect their Google account in their profile or smth like that and then next time they could also use Google auth. It would require developing custom actions to pull it off, I'm just trying to think what you could without us implementing the feature