-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Facebook link and unlink overwrites username field #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Definitely seems like a bug, the |
I wrote a regression test to check for this issue, and the test passes: #1538 Can you either check out that PR and tell me any differences between what you are doing to see this issue and what the test case does? Either that or provide your own test case that reproduces the issue, as a series of cURL requests or JS SDK calls. |
You'll have to forgive me, I am not much of a developer (hence my use of Parse.com). What is PR? And can I just copy the JS SDK calls you wrote into a cloud code function? I am not really familiar with writing test cases. |
PR is "Pull Request", basically a proposed change to the codebase. The JS SDK calls in that PR have a little bit a special code that makes them work in the test environment. The best way to write a test case is to provide some JS code that I can run on a blank database that demonstrates the issue. |
I'm not sure how to write JS code that reproduces the issue when I was seeing the issue while using the iOS SDK. This is the code I used in my app:
And then I call this to store the facebookId as a field on the User object:
So do I just try replicating this with javascript code? Your regression test looks like you already replicated this. I'm not doing anything special here, just calling |
In that case you could enable verbose logging in your server, and run through this code once with a link + unlink. Then, go to your server logs and paste the requests and responses here. |
I hope I sanitized these properly. |
Closing due to lack of activity, please reopen if the issue persist with the latest version. Don't forget to include your current:
|
Running Parse-Server 2.2.7, Facebook SDK, 4.10.1. Environment: Heroku + MongoLab.
In my app, when a user signs up, I set their username equal to their email address.
My app doesn't have facebook login, so users use their email address to log in. But it does have a Connect to Facebook feature (available once logged in) where I call
[PFFacebookUtils linkUserInBackground: user withReadPermissions: permissions]
When I do this, the user's username field is overwritten with a random string of characters. At first I thought this must be for Facebook authentication and I'll just have to create a workaround since my users always log in with an email and password (without the workaround, login then fails). So when I link a user with facebook, I call a cloud code function to set their username equal to their email address again.
However, when I unlink the user from facebook, the username field is again overwritten with a string of random characters. Now it doesn't make any sense. I could write another cloud code function to set the fields equal to each other, but I first wanted to ask if this is normal, or is it a bug?
The string of random characters is not the user's facebook id, nor is it their access token. I have no idea what it is. It's 32 characters long. The string when I link is not the same as when I unlink.
The text was updated successfully, but these errors were encountered: