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

[BUG] Login/Signup with Google with existing basic email/password account #734

Open
0xMurage opened this issue Jun 2, 2021 · 2 comments
Assignees

Comments

@0xMurage
Copy link
Collaborator

0xMurage commented Jun 2, 2021

Describe the bug:

Signup/Sign in with Google while one already has a basic password account with a similar email redirects the user to a blank page.

Expected Behavior

If I already have a basic password account, I should get logged in successfully (the system should merge existing user identity + mark account email as verified), or I should see account already exist error.

Current Behavior

The user is redirected to a blank callback page.

Steps to reproduce

  1. Sign up with username/password/email form
  2. Sign in with Google using the same email account used above

Error Log / Stack Trace (where applicable)

  • /api/v1/oauth2s returns 200 OK status
  • A 404 error (Wrong username or password) is returned on /api/v1/auth endpoint

Tell us about your browser and operating system:

  • Operating System: Linux x64
  • NodeJS Version:
  • Ember Version:

Screenshots where applicable

Screenshot from 2021-06-02 09-25-36

@jim4067
Copy link
Contributor

jim4067 commented Nov 3, 2021

Perhaps we could add some form of validation in the back end to prevent double sign up if user already exists and a email already exists error/notification for the front end?

@jim4067
Copy link
Contributor

jim4067 commented Nov 3, 2021

also, what does the following code do?

} catch (err) {
if (err.constraint == 'users_email_unique') {
let user = await User.query().where('email', newUser.email);
delete user[0].hash;
user = user[0];
ctx.status = 200;
ctx.body = { oauth2: user };
} else {
log.error(err);
ctx.throw(err.status.code, null, { errors: [err.message] });
}
}
});

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

No branches or pull requests

4 participants