1
0
Эх сурвалжийг харах

Update AuthServiceProvider

Daniel Supernault 6 жил өмнө
parent
commit
c4151c3751

+ 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"',
+        ]);
     }
 }