pixelfed/app/Auth/BearerTokenResponse.php

25 lines
683 B
PHP
Raw Normal View History

2022-03-25 03:42:58 +00:00
<?php
namespace App\Auth;
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
class BearerTokenResponse extends \League\OAuth2\Server\ResponseTypes\BearerTokenResponse
{
/**
* Add custom fields to your Bearer Token response here, then override
* AuthorizationServer::getResponseType() to pull in your version of
* this class rather than the default.
*
*
* @return array
*/
protected function getExtraParams(AccessTokenEntityInterface $accessToken)
{
return [
2025-01-05 20:49:13 +00:00
'scope' => array_map(fn ($scope) => $scope->getIdentifier(), $accessToken->getScopes()),
'created_at' => time(),
2022-03-25 03:42:58 +00:00
];
}
}