BearerTokenResponse.php 636 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Auth;
  3. use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
  4. class BearerTokenResponse extends \League\OAuth2\Server\ResponseTypes\BearerTokenResponse
  5. {
  6. /**
  7. * Add custom fields to your Bearer Token response here, then override
  8. * AuthorizationServer::getResponseType() to pull in your version of
  9. * this class rather than the default.
  10. *
  11. * @param AccessTokenEntityInterface $accessToken
  12. *
  13. * @return array
  14. */
  15. protected function getExtraParams(AccessTokenEntityInterface $accessToken)
  16. {
  17. return [
  18. 'created_at' => time(),
  19. ];
  20. }
  21. }