How can I merge a email login with a google+/facebook login

23 views
Skip to first unread message

mrin...@gmail.com

unread,
May 7, 2019, 2:07:42 AM5/7/19
to Back4App
User signups using email and password

He uninstalls the app.
Re installs the app.

He doesn't remember the password, so uses google+/facebook  account linked with the same email

I get the authData but now if I call  loginWithInBackground(authData), it will create new user with the authdata.

Can I merge the earlier account with the new one? 

Possible solution I can think of 
1.  Login the earlier user in and then link the google+ account but since the user doesn't remember the password, and since I can't fetch the password, this won't work.
2.  Query the user table for the email, if exists and not linked with google+, error out describing the situation. But how can I get the authData of the query returned user?

Davi Macêdo

unread,
May 7, 2019, 2:45:52 AM5/7/19
to Back4App
Have you tested the scenario you described? I think Parse Server will not allow two different users with the same e-mail to be created and will return an error that you can revert to the user.

mrin...@gmail.com

unread,
May 7, 2019, 3:12:10 AM5/7/19
to Back4App


On Tuesday, May 7, 2019 at 12:15:52 PM UTC+5:30, Davi Macêdo wrote:
Have you tested the scenario you described? I think Parse Server will not allow two different users with the same e-mail to be created and will return an error that you can revert to the user.


Yes I have tested the scenario. Parse server doesn't allow two users to be created with the same email. Actually it's the correct thing to do. I can revert back to the user with error message. But can I get the authData of the queried user? 

Davi Macêdo

unread,
May 7, 2019, 1:57:39 PM5/7/19
to Back4App
Yes. You can. The Parse Server api returns the authData on a User class query.
Reply all
Reply to author
Forward
0 new messages