This repository was archived by the owner on Aug 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,15 @@ module.exports = function() {
23
23
providerData . refreshToken = refreshToken ;
24
24
25
25
// Create the user OAuth profile
26
+ var displayName = profile . displayName . trim ( ) ;
27
+ var iSpace = displayName . indexOf ( ' ' ) ; // index of the whitespace following the firstName
28
+ var firstName = iSpace !== - 1 ? displayName . substring ( 0 , iSpace ) : displayName ;
29
+ var lastName = iSpace !== - 1 ? displayName . substring ( iSpace + 1 ) : '' ;
30
+
26
31
var providerUserProfile = {
27
- displayName : profile . displayName ,
32
+ firstName : firstName ,
33
+ lastName : lastName ,
34
+ displayName : displayName ,
28
35
email : profile . emails [ 0 ] . value ,
29
36
username : profile . username ,
30
37
provider : 'github' ,
Original file line number Diff line number Diff line change @@ -23,8 +23,15 @@ module.exports = function() {
23
23
providerData . tokenSecret = tokenSecret ;
24
24
25
25
// Create the user OAuth profile
26
+ var displayName = profile . displayName . trim ( ) ;
27
+ var iSpace = displayName . indexOf ( ' ' ) ; // index of the whitespace following the firstName
28
+ var firstName = iSpace !== - 1 ? displayName . substring ( 0 , iSpace ) : displayName ;
29
+ var lastName = iSpace !== - 1 ? displayName . substring ( iSpace + 1 ) : '' ;
30
+
26
31
var providerUserProfile = {
27
- displayName : profile . displayName ,
32
+ firstName : firstName ,
33
+ lastName : lastName ,
34
+ displayName : displayName ,
28
35
username : profile . username ,
29
36
provider : 'twitter' ,
30
37
providerIdentifierField : 'id_str' ,
You can’t perform that action at this time.
0 commit comments