You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
The application will fail without any errors to logs.
On further investigation,
the code failed in config/strategies/github.js at the line:
// Create the user OAuth profilevardisplayName=profile.displayName.trim();
Because profile.displayName is undefined.
Suggested fix:
'use strict';/** * Module dependencies. */varpassport=require('passport'),GithubStrategy=require('passport-github').Strategy,config=require('../config'),users=require('../../app/controllers/users.server.controller');module.exports=function(){// Use github strategypassport.use(newGithubStrategy({clientID: config.github.clientID,clientSecret: config.github.clientSecret,callbackURL: config.github.callbackURL,passReqToCallback: true},function(req,accessToken,refreshToken,profile,done){// Set the provider data and include tokensvarproviderData=profile._json;providerData.accessToken=accessToken;providerData.refreshToken=refreshToken;// Create the user OAuth profile// displayName may be undefinedvardisplayName=profile.username||profile.displayName;displayName=displayName.trim();variSpace=displayName.indexOf(' ');// index of the whitespace following the firstNamevarfirstName=iSpace!==-1 ? displayName.substring(0,iSpace) : displayName;varlastName=iSpace!==-1 ? displayName.substring(iSpace+1) : '';varproviderUserProfile={firstName: firstName,lastName: lastName,displayName: displayName,email: profile.emails[0].value,username: profile.username,provider: 'github',providerIdentifierField: 'id',providerData: providerData};// Save the user OAuth profileusers.saveOAuthUserProfile(req,providerUserProfile,done);}));};
The text was updated successfully, but these errors were encountered:
eric-vader
changed the title
Github Login may fail upon undefined profile
Github Login will fail upon undefined profile
Apr 16, 2015
eric-vader
changed the title
Github Login will fail upon undefined profile
Github Login will fail upon undefined displayName
Apr 16, 2015
To reproduce Bug:
The application will fail without any errors to logs.
On further investigation,
the code failed in
config/strategies/github.js
at the line:Because profile.displayName is undefined.
Suggested fix:
The text was updated successfully, but these errors were encountered: