瀏覽代碼

Return access tokens' scopes, not hardcoded list

Emelia Smith 1 年之前
父節點
當前提交
7b0a6060b2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Auth/BearerTokenResponse.php

+ 2 - 2
app/Auth/BearerTokenResponse.php

@@ -18,8 +18,8 @@ class BearerTokenResponse extends \League\OAuth2\Server\ResponseTypes\BearerToke
     protected function getExtraParams(AccessTokenEntityInterface $accessToken)
     {
         return [
-        	'created_at' => time(),
-        	'scope' => 'read write follow push'
+            'created_at' => time(),
+            'scope' => implode(' ', $accessToken->getScopes())
         ];
     }
 }