Skip to content

Unable to Login using JavaScript / REST API #85

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

Closed
rudymacias opened this issue Jan 30, 2016 · 7 comments
Closed

Unable to Login using JavaScript / REST API #85

rudymacias opened this issue Jan 30, 2016 · 7 comments
Labels
type:question Support or code-level question

Comments

@rudymacias
Copy link

Both ways trying to login returns

{"code":1,"message":"Internal server error."}

Set up server with Heroku and the logs state:

2016-01-30T22:23:30.852720+00:00 app[web.1]: Uncaught internal server error. bad obj: undefined undefined

Any help would be appreciated!

@gfosco
Copy link
Contributor

gfosco commented Jan 30, 2016

This error is being thrown here: https://github.com/ParsePlatform/parse-server/blob/7f5d744ce2eea774a10ab0a8c47bd587941c7775/Schema.js#L294

Can you provide the result from the _SCHEMA collection in mongo for the _User class?

@rudymacias
Copy link
Author

{
"_id": "_User",
"group": "string",
"status": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"username": "string",
"password": "string",
"updatedAt": "string",
"createdAt": "string",
"objectId": "string"
}

@gfosco
Copy link
Contributor

gfosco commented Jan 31, 2016

Ok, that doesn't tell us much. Can you provide the login code you're using? If you can, set the environment variable VERBOSE=1 and capture that log as well.

@rudymacias
Copy link
Author

Sorry ok here is the curl request:

curl -X GET
-H "X-Parse-Application-Id: myAppId"
-H "X-Parse-REST-API-Key: myRestAPIKey"
-H "X-Parse-Revocable-Session: 1"
-G
--data-urlencode 'username=[email protected]'
--data-urlencode 'password=12345678'
https://intense-bayou-17052.herokuapp.com/parse/login

Heroku LOG:

2016-01-31T00:29:11.502181+00:00 app[web.1]: Uncaught internal server error. bad obj: undefined undefined
2016-01-31T00:29:11.513905+00:00 heroku[router]: at=info method=GET path="/parse/login?username=test%40yahoo.com&password=12345678" host=intense-bayou-17052.herokuapp.com request_id=2de8daf8-cbc5-4d47-9d50-ca085c599a22 fwd="75.1.114.162" dyno=web.1 connect=0ms service=1541ms status=500 bytes=358

@cainoeraabele
Copy link

in my case the problem is here : https://github.com/ParsePlatform/parse-server/blob/7f5d744ce2eea774a10ab0a8c47bd587941c7775/users.js#L71

in the user.js file
when try to validate the schema, req.info.installationId was undefined.
For now i have deleted that line and everything working good

@rudymacias
Copy link
Author

@cainoeraabele Thanks! Yes that worked for me too, OH and also, not sure if my JS App or the Parse Server was in fault, but the Schema for Session had "expiresAt" as "number" so that also thru errors. Changing that to "string" corrected the issue. I'm able to Login finally YEAH!

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

I think we've got these covered in 2.0.4... Open new issues if you have problems. Thanks.

@gfosco gfosco closed this as completed Feb 2, 2016
@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

4 participants