Update email and name from oauth providers only if empty
This commit is contained in:
@@ -76,8 +76,8 @@ class Github extends Base
|
|||||||
return $this->user->update(array(
|
return $this->user->update(array(
|
||||||
'id' => $user_id,
|
'id' => $user_id,
|
||||||
'github_id' => $profile['id'],
|
'github_id' => $profile['id'],
|
||||||
'email' => $profile['email'] ?: $user['email'],
|
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
|
||||||
'name' => $profile['name'] ?: $user['name'],
|
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ class Gitlab extends Base
|
|||||||
return $this->user->update(array(
|
return $this->user->update(array(
|
||||||
'id' => $user_id,
|
'id' => $user_id,
|
||||||
'gitlab_id' => $profile['id'],
|
'gitlab_id' => $profile['id'],
|
||||||
'email' => $profile['email'] ?: $user['email'],
|
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
|
||||||
'name' => $profile['name'] ?: $user['name'],
|
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ class Google extends Base
|
|||||||
return $this->user->update(array(
|
return $this->user->update(array(
|
||||||
'id' => $user_id,
|
'id' => $user_id,
|
||||||
'google_id' => $profile['id'],
|
'google_id' => $profile['id'],
|
||||||
'email' => $profile['email'] ?: $user['email'],
|
'email' => empty($user['email']) ? $profile['email'] : $user['email'],
|
||||||
'name' => $profile['name'] ?: $user['name'],
|
'name' => empty($user['name']) ? $profile['name'] : $user['name'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user