mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
feat: added methods for adding and getting scopes
This commit is contained in:
parent
2660fcfc3b
commit
230b039bbd
1 changed files with 19 additions and 2 deletions
|
|
@ -45,8 +45,6 @@ abstract class OAuth
|
|||
$this->callback = $callback;
|
||||
$this->state = $state;
|
||||
$this->scopes = $scopes;
|
||||
var_dump($scopes);
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -87,7 +85,26 @@ abstract class OAuth
|
|||
*/
|
||||
abstract public function getUserName(string $accessToken):string;
|
||||
|
||||
/**
|
||||
* @param $scope
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function addScope(string $scope){
|
||||
// Add a scope to the scopes array if it isn't already present
|
||||
if (!in_array($scope, $this->scopes)){
|
||||
$this->$scopes[] = $scope;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getScopes(){
|
||||
return $this->scopes;
|
||||
}
|
||||
|
||||
|
||||
// The parseState function was designed specifically for Amazon OAuth Adapter to override.
|
||||
// The response from Amazon is html encoded and hence it needs to be html_decoded before
|
||||
// json_decoding
|
||||
|
|
|
|||
Loading…
Reference in a new issue