Refactoring of Github authentication (oauth url change)
This commit is contained in:
@@ -22,6 +22,7 @@ class Google extends Base
|
||||
/**
|
||||
* OAuth2 instance
|
||||
*
|
||||
* @access private
|
||||
* @var \Core\OAuth2
|
||||
*/
|
||||
private $service;
|
||||
@@ -71,11 +72,13 @@ class Google extends Base
|
||||
*/
|
||||
public function updateUser($user_id, array $profile)
|
||||
{
|
||||
$user = $this->user->getById($user_id);
|
||||
|
||||
return $this->user->update(array(
|
||||
'id' => $user_id,
|
||||
'google_id' => $profile['id'],
|
||||
'email' => $profile['email'],
|
||||
'name' => $profile['name'],
|
||||
'email' => $profile['email'] ?: $user['email'],
|
||||
'name' => $profile['name'] ?: $user['name'],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -114,7 +117,7 @@ class Google extends Base
|
||||
|
||||
return $this->httpClient->getJson(
|
||||
'https://www.googleapis.com/oauth2/v1/userinfo',
|
||||
array($this->getService()->getAuthorizationHeader()
|
||||
));
|
||||
array($this->getService()->getAuthorizationHeader())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user