/**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
     Passport::tokensExpireIn(Carbon::now()->addDays(1));
     Passport::refreshTokensExpireIn(Carbon::now()->addDays(2));
     Passport::pruneRevokedTokens();
 }
 /**
  * @return void
  */
 public function register()
 {
     Passport::cookie('notadd_token');
     $this->registerAuthorizationServer();
     $this->registerResourceServer();
     $this->registerGuard();
     $this->app->singleton('api', function ($app) {
         return new Passport($app, $app['events']);
     });
 }
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
     // Token Lifetimes
     //        Passport::tokensExpireIn(Carbon::now()->addDays(15));
     // Refresh Token Lifetimes
     //        Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
     // Pruning Revoked Tokens
     //        Passport::pruneRevokedTokens();
     // Token Scopes
     //        Passport::tokensCan([
     //            'place-orders' => 'Place orders',
     //            'check-status' => 'Check order status',
     //        ]);
 }
 /**
  * Parse scopes for authorization request.
  *
  * @param \League\OAuth2\Server\RequestTypes\AuthorizationRequest $authRequest
  *
  * @return array
  */
 protected function parseScopes(AuthorizationRequest $authRequest)
 {
     return Passport::scopesFor(collect($authRequest->getScopes())->map(function ($scope) {
         return $scope->getIdentifier();
     })->all());
 }
Beispiel #5
0
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
 }
Beispiel #6
-1
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     Passport::ignoreMigrations();
     Passport::tokensExpireIn(Carbon::now()->addDays(1));
     Passport::refreshTokensExpireIn(Carbon::now()->addMonths(3));
     if ($path = config('services.passport.path')) {
         Passport::keyPath($path);
     }
     Passport::routes();
 }