mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-07 12:52:10 +02:00
Merge pull request #688 from codydaig/bugfix/github_undefined_displayname
If displayName in GitHub is undefined use username Fixes #519
This commit is contained in:
@@ -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) : '';
|
||||
|
||||
Reference in New Issue
Block a user