Change User's Social Login Email Address

Has anyone had any luck updating a user’s email address when they change it in a connected social media account?

Seems that if they change their email address in the linked social login they can still log in, but their account stays tied to an email address they potentially cannot or do not access anymore (e.g. if they used a company address and move to a new company).

If the email address is updated in Bubble, when they run through the social log in / sign up API, it goes through the sign up process instead, resulting in an error that the email is already registered, thus losing access to their account.

1 Like

One way I’ve managed this in the past, but I’m unsure if it’s best practice or not, is I just used the social platforms unique Id + my domain name for their account instead.

So for example, Oauth to Discord, then instead of getting the users email address and signing that up, I would just get the discord ID as a string and use that as the name then

It technically works, and is pretty secure, but I’m sure there would be other ways people manage it too :slightly_smiling_face:

Always match social logins to an account using their ID, not their email.

If there’s already an account with that ID, show an error saying it’s already linked to another account.

It’s safe to show this ID to check against existing users.

Thanks all!

Can you tell me how I would do that, as the LinkedIn and Google login plugins (haven’t tried others) don’t present an option to do this.

I’m using the Bubble made plugins

You can use the bubble API connector and use the Oauth built in option, or you can just make the handshake calls yourself.

That way when you’re making a call to the provider you can get ID, plus a lot of other info.

I’m guessing your app will want to connect to LinkedIn? You can also pass a lot of LinkedIn data, like from work experience, connections etc, since you’re directly connecting to the profile then

Thanks Oliver,

Are there any userful links you could point me at to help set this up.

I set up my own LinkedIn API connection for profile info (but then moced to the Bubble plugin), but am struggling to find anything userful to help me understand how to pull the rest of their profile data.

Nice, having your own API set up for it is good, you should be defining the permissions there and then getting a token back yeah?

Yep, it’s working fine to pull the basic profile info:,name,given_name,family_name,picture,locale,email,email_verified)

Perfect, that should also be pushing a unique ID which you can use for login as above.

Then you should be able to also request permission for job history etc? Not at my desk atm but I’ll have a look at the docs when I get a chance

1 Like