From 45aa876187fbfca86b7a14e77850da4e369766e9 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Tue, 12 Mar 2024 14:17:42 +0300 Subject: [PATCH] Prepare scopes array to bind to model --- com_oauthserver/site/src/Entity/AccessToken.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com_oauthserver/site/src/Entity/AccessToken.php b/com_oauthserver/site/src/Entity/AccessToken.php index cf0fc21..00496c6 100644 --- a/com_oauthserver/site/src/Entity/AccessToken.php +++ b/com_oauthserver/site/src/Entity/AccessToken.php @@ -24,11 +24,13 @@ class AccessToken implements AccessTokenEntityInterface 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() ]; }