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

Undefined error when trying to login an oauth user with email #1444

Closed
davidruisinger opened this issue Apr 10, 2016 · 2 comments
Closed

Undefined error when trying to login an oauth user with email #1444

davidruisinger opened this issue Apr 10, 2016 · 2 comments

Comments

@davidruisinger
Copy link

Environment Setup

Backend: Parse Server 2.2.6
Frontend Web App: Parse JS SDK 1.8.1

Steps to reproduce

  1. Login to parse using one of the 3rd party oauth providers
  2. Check DB => New user with oauth data is created
  3. Add an username/email (in my case they are equal) to that oauth user (Note: I do NOT have a password set for the user)
  4. Logout
  5. Try to login using the username/email that just has been added to the oauth user
    => Getting an undefined error since that user has NO password (which was on purpose)

Expected behavior:
=> Getting an error that tells me that this user has no password so that I can handle that error in my front end code.

Logs/Trace

Parse Server VerboseMode output (multiple times the same error):

verbose: GET /api/login { host: '192.168.0.132:1337',
  'content-type': 'text/plain',
  origin: 'file://',
  connection: 'keep-alive',
  accept: '*/*',
  'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13E238 (5751683120)',
  'accept-language': 'de-de',
  'accept-encoding': 'gzip, deflate',
  'content-length': '221' } {
  "username": "MY_EMAIL",
  "password": "MY_PASSWORD"
}
verbose: error: Incorrect arguments
error: Uncaught internal server error. Incorrect arguments undefined
@flovilmart
Copy link
Contributor

In order to let an Oauth authenticated user to login with a password, you'd have to set username and Password properties on the user. Did you do that?

@davidruisinger
Copy link
Author

No, I "only" have added the email/username (are equal in my case) to the user but NO password. I'm totally aware that the user should not be able to login but I just wanted to note that that case is not properly handled by any error. If a user who has NOT set up a password yet (but has an username/email) tries to login I would expect to get an error that I can handle in my fronted to make the user aware of the issue. So far I can't really handle the error...

(I updated the OP to be more specific)

flovilmart added a commit that referenced this issue Apr 11, 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

No branches or pull requests

2 participants