diff --git a/src/Auth/OAuth/Discord.php b/src/Auth/OAuth/Discord.php index b23653e992..01a7013bb4 100644 --- a/src/Auth/OAuth/Discord.php +++ b/src/Auth/OAuth/Discord.php @@ -19,10 +19,12 @@ class Discord extends OAuth */ protected $user = []; - + /** + * @var array + */ protected $scope = [ - 'identify', - 'email' + 'identify', + 'email' ]; /** @@ -43,7 +45,8 @@ class Discord extends OAuth 'response_type' => 'code', 'client_id' => $this->appID, 'scope' => implode(' ', $this->scope), - 'redirect_uri' => $this->callback + 'state' => json_encode($this->state), + 'redirect_uri' => $this->callback, ]); return $url; @@ -70,10 +73,8 @@ class Discord extends OAuth ]) ); - $accessToken = json_decode($accessToken, true); - if (isset($accessToken['access_token'])) { return $accessToken['access_token']; }