Closed preriasusi closed 6 years ago
There are two source files which handle the GitHub registration and verification. No changes in the code recently. Unless the GitHub OAuth login module or lodash has changed - and it looks like they have not - the issues could well be due to some configuration change.
Performed when a new account is created: -platform/apinf_packages/users/server/accounts_hooks.js
// from row 12 owards
Accounts.onCreateUser((options, user) => { //this method is activated when creating a user
..
// Check services object exists
if (user.services) {
// Case 1: Register with Github
if (user.services.github) {
// Set user email address from Github email
user.emails = [
{
address: user.services.github.email,
verified: true, // <------ This is where the verified flag is set
},
];
Performed on each login attempt: -platform/apinf_packages/users/server/login_verify.js
//from row 39 onwards:
if (user && user.emails && (user.emails.length > 0)) {
// Get user emails
const emails = parameters.user.emails;
// Check if any of user's emails are verified
const verified = _.find(emails, (email) => { return email.verified; }); //Note: _.find() returns true if at least one is true
// If no email is verified, throw an error
if (!verified) { //<------ Here's where the verified flag is checked
throw new Meteor.Error(500, TAPi18n.__('loginVerify_errorMessage'));
//Note: loginVerify_errorMessage = "We have sent you an email. Please verify your email address."
On current staging with 0.51.1 whenI try to sign up with github, I get notifigation "We have sent you an email. Please verify your email address.". No email comes anyway.
When I go to sign in, and I re-send verification email, I get it, and I get my account working.
Investigation result report
0.50.0 version of the release. Verified on apinf.io and development environment with tag 0.50.0 Sign Up/ Sign in via GitHub work as expected.
0.51.1 version of the release. Verified on staging.apinf.io and development environment with tag 0.51.1 Sign Up doesn't work via GitHub
No changes in the code are related to the registered mechanism. Perhaps, problem came from Meteor itself (https://github.com/meteor/meteor/issues/8510)
develop
branch
Sign Up/ Sign in via GitHub work as expected.After 0.52 release a new client can sign up/sign in via GitHub without the problem. We need to take care of the old clients with the problem.
Assume solutions
Create a new migration step that will set flag "true" for all GitHub accounts that are false verification. The 0.52 release will include this migration and these changes will be applied to nightly, staging and production sites. OR
The fastest way to staging: Manually in the database check all GitHub accounts as verified these are not so. On another hand, we need to repeat this step for production site after 0.52 release. OR (if it is possible)
Send verification e-mail if verification fails for some reason. Not sure about this step - can we handle this?
@anarva to check the possibilities to update Github library
Checked the health of the accounts-github implementation which is part of Meteor core packages. It' active and the development process is ongoing. As long as we continue using Meteor/blaze, this current way is the correct way to use Github login.
To improve the Github login experience, my recommendation is to improve the error handling and reporting of the current login process. For each failed login attempt, all available info should be stored for future reference.
To access the docker logs (including the errors with sing up) you need to do the following:
[Sentry] [Apinf Team Apinf production] error: : We have sent you an email. Please verify your email address. [500]1 message Unknown person Title: Login issues in apinf.io
Steps
Actual result:
Expected result:
[Sentry] [Apinf Team Apinf production] error: : We have sent you an email. Please verify your email address. [500]1 message Unknown person
"Internal server error" when trying to login/register using github on apinf.io and nightly.