From 3d3468b663db5624ac715114d1c043286486b68d Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Tue, 12 Mar 2024 23:09:12 +0300 Subject: [PATCH] Prepare scopes array to bind to model --- com_oauthserver/site/src/Entity/AuthCode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() ]; }