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

If displayName in Github is undefined #688

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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