summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-15 11:41:27 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-15 11:41:27 +0200
commit4ea2daf04dd4df47fe1bdfcae3e87d0122d26fce (patch)
tree21749a54b67c36cdc7381c8de9ebc32103b20161 /lib
parent991d9b5c3acb21b65aed9c52c4b18c47ff1951e2 (diff)
downloadnextcloud-server-4ea2daf04dd4df47fe1bdfcae3e87d0122d26fce.tar.gz
nextcloud-server-4ea2daf04dd4df47fe1bdfcae3e87d0122d26fce.zip
Refix scope
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Authentication/Token/DefaultToken.php6
-rw-r--r--lib/private/Authentication/Token/IToken.php2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php
index ad4ece0c463..e2753ba979c 100644
--- a/lib/private/Authentication/Token/DefaultToken.php
+++ b/lib/private/Authentication/Token/DefaultToken.php
@@ -158,9 +158,11 @@ class DefaultToken extends Entity implements IToken {
return $scope;
}
- public function setScope(array $scope = null) {
- if ($scope !== null) {
+ public function setScope($scope) {
+ if (\is_array($scope)) {
parent::setScope(json_encode($scope));
+ } else {
+ parent::setScope((string)$scope);
}
}
diff --git a/lib/private/Authentication/Token/IToken.php b/lib/private/Authentication/Token/IToken.php
index eff525c8d65..b40f55fb6ca 100644
--- a/lib/private/Authentication/Token/IToken.php
+++ b/lib/private/Authentication/Token/IToken.php
@@ -94,7 +94,7 @@ interface IToken extends JsonSerializable {
*
* @param array $scope
*/
- public function setScope(array $scope = null);
+ public function setScope($scope);
public function getName(): string;