Skip to content
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

Fixed invalid facebook login sessionToken #173

Merged
merged 4 commits into from
Feb 3, 2016

Conversation

taylorstine
Copy link
Contributor

This is an attempt to address this todo. Please scrutinize this carefully as I am unsure of it's implications elsewhere.

Although I am able to login with Facebook, when I try to retrieve any data, I get empty results because the session token I am passing to ParseServer is not found in my list of "SessionTokens" and because it is not created as expected. As the TODO specifies, the original version of parse included the correct "createdWith" parameter and passed an installation ID to the "SessionToken" write operation.

Here I store the createdWith parameter in this.data, and pass along the installation id sent by the user and set in req.info.installationId.

It also appeared as though the expiresAt property was not set, so I also added that.

The expiresAt key is being written to the database as _expiresAt. I'm not sure where this is coming from, since it looks like the original Parse implementation wrote expiresAt to the database (from looking directly at my mongo data). As a side note, the Parse Dashboard throws an error if the _expiresAt field is set. I'm not sure of the implications of this either.

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Getting an error:

ParseUser.spec.js:1430
        expect(b.createdWith.action).toEqual('create');
                            ^

TypeError: Cannot read property 'action' of undefined

@taylorstine
Copy link
Contributor Author

@gfosco updated, it looks like this line is causing the issue. I'm assuming the purpose of setting the expiredAt parameter to 0 is so that it never expires, but I'm not sure. As a default I set it to expire in one year, like the user session token.

Also fixed an issue with the Facebook signup username not populating. With the original Parse, when signing up with Facebook for the first time, Parse added a uuid for the username. I've replicated that functionality here.

gfosco added a commit that referenced this pull request Feb 3, 2016
Fixed invalid facebook login sessionToken
@gfosco gfosco merged commit f04656e into parse-community:master Feb 3, 2016
@gfosco
Copy link
Contributor

gfosco commented Feb 3, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants