Skip to content

Commit

Permalink
fix(youtube): update oauth2 urls (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
robiiinos authored Oct 22, 2020
1 parent e5ff62c commit 0c82b39
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class Provider extends AbstractProvider
/**
* {@inheritdoc}
*/
protected $scopes = ['https://www.googleapis.com/auth/youtube.readonly'];
protected $scopes = [
'https://www.googleapis.com/auth/youtube.readonly',
];

/**
* {@inheritdoc}
Expand All @@ -28,7 +30,7 @@ class Provider extends AbstractProvider
protected function getAuthUrl($state)
{
return $this->buildAuthUrlFromBase(
'https://accounts.google.com/o/oauth2/auth',
'https://accounts.google.com/o/oauth2/v2/auth',
$state
);
}
Expand All @@ -38,7 +40,7 @@ protected function getAuthUrl($state)
*/
protected function getTokenUrl()
{
return 'https://accounts.google.com/o/oauth2/token';
return 'https://oauth2.googleapis.com/token';
}

/**
Expand All @@ -64,9 +66,11 @@ protected function getUserByToken($token)
protected function mapUserToObject(array $user)
{
return (new User())->setRaw($user)->map([
'id' => $user['id'], 'nickname' => $user['snippet']['title'],
'name' => null, 'email' => null,
'avatar' => $user['snippet']['thumbnails']['high']['url'],
'id' => $user['id'],
'nickname' => $user['snippet']['title'],
'name' => null,
'email' => null,
'avatar' => $user['snippet']['thumbnails']['high']['url'],
]);
}

Expand Down

0 comments on commit 0c82b39

Please sign in to comment.