Skip to content

Commit

Permalink
Address issue if no first or last name in token
Browse files Browse the repository at this point in the history
  • Loading branch information
psignoret committed Jul 18, 2018
1 parent 4e86aea commit c58fbbe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aad-sso-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,15 @@ function get_wp_user_from_aad_user( $jwt, $group_memberships ) {
)
);
}

// Setup the minimum required user data
// TODO: Is null better than a random password?
// TODO: Look for otherMail, or proxyAddresses before UPN for email
$userdata = array(
'user_email' => $unique_name,
'user_login' => $unique_name,
'first_name' => $jwt->given_name,
'last_name' => $jwt->family_name,
'first_name' => ! empty( $jwt->given_name ) ? $jwt->given_name : '',
'last_name' => ! empty( $jwt->family_name ) ? $jwt->family_name : '',
'user_pass' => null,
);

Expand Down

0 comments on commit c58fbbe

Please sign in to comment.