From c5df0627bdcd509dadfbca6689d06c941c74f2df Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 13 Jan 2020 22:59:53 +0200 Subject: [PATCH] Added missing state param --- src/Auth/OAuth/Discord.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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']; }