wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Better user account merging logic

Open shayneczyzewski opened this issue 2 years ago • 8 comments

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/blob/main/waspc/data/Generator/templates/server/src/routes/auth/passport/generic/provider.js#L55

It would be better to allow an optional user-defined function to do this check. They could, for example, see that a GitHub user with email "[email protected]" is already associated with User 123, so when a Google user with the same email logs in for the first time we can associate them with the same user.

shayneczyzewski avatar Jan 16 '23 16:01 shayneczyzewski

It would also be nice if this method allowed users to link a social auth method to their currently logged-in account.

shayneczyzewski avatar Jan 16 '23 16:01 shayneczyzewski

One thing to possibly keep an eye out for here is associating new social user with a email & password user that doesn't have a verified email -> that can result in a security issue where somebody created account with somebody's email and then gains access if that actual email owner logins with social account.

Martinsos avatar Apr 27 '23 16:04 Martinsos

We have new issue for this, to actually re-implement it.

Martinsos avatar Mar 12 '24 18:03 Martinsos

@Martinsos I don't think we have a new issue for this? I used this one in our planning 😄

infomiho avatar Mar 12 '24 18:03 infomiho

Ah whoops I thought you created a new one, something like "Implement account merging logic"! OK, leaving this one then!

Martinsos avatar Mar 12 '24 19:03 Martinsos

User asking for this: https://discord.com/channels/686873244791210014/1271172858281852948/1271172858281852948

sodic avatar Aug 09 '24 09:08 sodic

User asking for this: https://discord.com/channels/686873244791210014/1271172858281852948/1271172858281852948

Since you mention it: I also recently started using Wasp and this feature would be my nº1 priority.

PAD333 avatar Aug 10 '24 11:08 PAD333