-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
authData:facebook vs _auth_data_facebook? #755
Comments
If you see the field in MongoDB that's totally normal, the auth data gets flatten for performance reasons. Can you properly login with Facebook? |
I can properly login, yes, but it's causing the other problems I mentioned, namely an invalid value for Parse.FacebookUtils.isLinked(user) and the ability to get the token from Parse Cloud. Any thoughts on those problems? |
Can you provide the code you're using in cloud code? |
Coffeescript:
The second console is what would have gotten me the token before but doesn't work anymore. |
Instead of Parse.FacebookUtils, do you get the right result if you query with the master key and check the authData key directly? user.get(userObjectId, { useMasterKey: true }).then((user) ->
if user.get('authData') && user.get('authData').facebook
console.log user.get('authData').facebook.access_token |
That does not solve it (I posted old code and was already calling useMasterKey). Even when the user is connected to Facebook, the authData field is showing up like this:
When I check mongo directly, I see the data is being stored in the "_auth_data_facebook" field and I don't seem to have any way to access that field as it's not showing up in the returned user object. |
I may be experiencing a related issue. When I log in with facebook, it creates a new user every time and that user cannot be modified; for example, if I try to update the username it reverts back to the random string provided by facebook. If I log out then back in with the same facebook account, it generates a brand new user, brand new random string. ** EDIT ** |
@michaelbina in your code, Is the user currently logged in? |
Yes. It's a Parse.Query(Parse.User) object. I'm not sure it should make a difference if the user is logged in since it's running from cloud code. Should I be doing something with a session token or something to get more user data or something? Here's the entire function:
|
This should be fixed by #952 |
Before migrating to parse-server on heroku, all of the Facebook auth data was stored in the authData field for a User object like so:
After migrating, I am seeing the field _auth_data_facebook like so:
First, why was this changed?
Second, I am having problems accessing the _auth_data_facebook from Parse Cloud.
A search for a user in parse cloud, returns the user object without the _auth_data_facebook field and with the facebook field in authData set to nil. Also my call to Parse.FacebookUtils.isLinked(user) returns false even thought its true and I have no way to retrieve the access token from the user object.
Any help would be appreciated in figuring out what I'm doing wrong or if this is a bug. Thanks!
The text was updated successfully, but these errors were encountered: