diff --git a/com_oauthserver/site/src/Entity/AuthCode.php b/com_oauthserver/site/src/Entity/AuthCode.php index 84a1ffb..5d23bfd 100644 --- a/com_oauthserver/site/src/Entity/AuthCode.php +++ b/com_oauthserver/site/src/Entity/AuthCode.php @@ -24,11 +24,13 @@ class AuthCode implements AuthCodeEntityInterface public function getData(): array { + $scopes = array_map(fn($scope) => ['scope' => (string) $scope], $this->getScopes()); + return [ 'identifier' => $this->getIdentifier(), 'expiry' => $this->getExpiryDateTime(), 'user_id' => $this->getUserIdentifier(), - 'scopes' => $this->getScopes(), + 'scopes' => $scopes, 'client_identifier' => $this->getClient()->getIdentifier() ]; }