瀏覽代碼

Update AuthServiceProvider

Daniel Supernault 6 年之前
父節點
當前提交
c4151c3751
共有 1 個文件被更改,包括 14 次插入3 次删除
  1. 14 3
      app/Providers/AuthServiceProvider.php

+ 14 - 3
app/Providers/AuthServiceProvider.php

@@ -25,8 +25,19 @@ class AuthServiceProvider extends ServiceProvider
     {
         $this->registerPolicies();
 
-        // Passport::routes();
-        // Passport::tokensExpireIn(now()->addDays(15));
-        // Passport::refreshTokensExpireIn(now()->addDays(30));
+        Passport::routes();
+        Passport::tokensExpireIn(now()->addDays(15));
+        Passport::refreshTokensExpireIn(now()->addDays(30));
+        Passport::enableImplicitGrant();
+        
+        Passport::setDefaultScope([
+            'user:read',
+            'user:write'
+        ]);
+
+        Passport::tokensCan([
+            'user:read' => 'Read a user’s profile info and media',
+            'user:write' => 'This scope lets an app "Change your profile information"',
+        ]);
     }
 }