Update email and name from oauth providers only if empty

This commit is contained in:
Frederic Guillot 2015-08-23 13:24:40 -04:00
parent 8eb739bb91
commit 062997e6ef
3 changed files with 6 additions and 6 deletions

View File

@ -76,8 +76,8 @@ class Github extends Base
return $this->user->update(array(
'id' => $user_id,
'github_id' => $profile['id'],
'email' => $profile['email'] ?: $user['email'],
'name' => $profile['name'] ?: $user['name'],
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
));
}

View File

@ -76,8 +76,8 @@ class Gitlab extends Base
return $this->user->update(array(
'id' => $user_id,
'gitlab_id' => $profile['id'],
'email' => $profile['email'] ?: $user['email'],
'name' => $profile['name'] ?: $user['name'],
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
));
}

View File

@ -77,8 +77,8 @@ class Google extends Base
return $this->user->update(array(
'id' => $user_id,
'google_id' => $profile['id'],
'email' => $profile['email'] ?: $user['email'],
'name' => $profile['name'] ?: $user['name'],
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
));
}