Creating an Account With Github


#1

Hi,

I’m working on a project with Meteor and React and I was trying to add GitHub (along with Twitter) login to my app.

I managed to set the authentication on Github. I added a button on the signup screen that goes to callback I set on Github. For some reason, however, I get a error 500 Internal Server Error whenever I try to sign up. I’m using Meteor.loginWithGithub to create the account. Do I need to run another command like a Meteor signin with Github?

Code:

Button:
<div onClick={() => this.gitHubLogin()} className="signup__loginWithGithub"><FontAwesomeIcon icon={['fab', 'github']} className={signup__loginWithGoogleIcon} /><div className="signup__loginWithGoogleText">Sign in With Github</div></div>

Method:

gitHubLogin() {
  Meteor.loginWithGithub({
      requestPermissions: ['user'],
  }, function (err) {
    console.log('error', err);
  });
}

Main.js on Server:

ServiceConfiguration.configurations.remove({
  service: "github"
});
ServiceConfiguration.configurations.insert({
service: "github" ,
loginStyle: "popup",
clientId: "xxx",
secret: "xxx"
});

Thank you for your time,
Oliver