Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #688 from codydaig/bugfix/github_undefined_display…
Browse files Browse the repository at this point in the history
…name

If displayName in GitHub is undefined use username
Fixes #519
  • Loading branch information
ilanbiala committed Jul 24, 2015
2 parents 3a39f0a + 7605956 commit 8a81cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(config) {
providerData.refreshToken = refreshToken;

// Create the user OAuth profile
var displayName = profile.displayName.trim();
var displayName = profile.displayName ? profile.displayName.trim() : profile.username.trim();
var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
Expand Down

0 comments on commit 8a81cf0

Please sign in to comment.