mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Added missing state param
This commit is contained in:
parent
ef597bbd9d
commit
c5df0627bd
1 changed files with 7 additions and 6 deletions
|
|
@ -19,10 +19,12 @@ class Discord extends OAuth
|
||||||
*/
|
*/
|
||||||
protected $user = [];
|
protected $user = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $scope = [
|
protected $scope = [
|
||||||
'identify',
|
'identify',
|
||||||
'email'
|
'email'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,7 +45,8 @@ class Discord extends OAuth
|
||||||
'response_type' => 'code',
|
'response_type' => 'code',
|
||||||
'client_id' => $this->appID,
|
'client_id' => $this->appID,
|
||||||
'scope' => implode(' ', $this->scope),
|
'scope' => implode(' ', $this->scope),
|
||||||
'redirect_uri' => $this->callback
|
'state' => json_encode($this->state),
|
||||||
|
'redirect_uri' => $this->callback,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
|
@ -70,10 +73,8 @@ class Discord extends OAuth
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$accessToken = json_decode($accessToken, true);
|
$accessToken = json_decode($accessToken, true);
|
||||||
|
|
||||||
|
|
||||||
if (isset($accessToken['access_token'])) {
|
if (isset($accessToken['access_token'])) {
|
||||||
return $accessToken['access_token'];
|
return $accessToken['access_token'];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue