Update BearerTokenResponse, return scopes in oauth/token endpoint. Fixes #5286

This commit is contained in:
Daniel Supernault 2025-01-05 13:45:05 -07:00
parent d6cf5a622a
commit d8f5c3027c
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -11,13 +11,13 @@ class BearerTokenResponse extends \League\OAuth2\Server\ResponseTypes\BearerToke
* AuthorizationServer::getResponseType() to pull in your version of
* this class rather than the default.
*
* @param AccessTokenEntityInterface $accessToken
*
* @return array
*/
protected function getExtraParams(AccessTokenEntityInterface $accessToken)
{
return [
'scopes' => array_map(fn ($scope) => $scope->getIdentifier(), $accessToken->getScopes()),
'created_at' => time(),
];
}