From 74cb1477bb921a2378ea22a552b71a48c11e0931 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 20 Jul 2018 16:34:32 +0200 Subject: Better API (integrated oauth completely) --- infrastructure/Auth/AuthServiceProvider.php | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 infrastructure/Auth/AuthServiceProvider.php (limited to 'infrastructure/Auth/AuthServiceProvider.php') diff --git a/infrastructure/Auth/AuthServiceProvider.php b/infrastructure/Auth/AuthServiceProvider.php new file mode 100644 index 0000000..944f812 --- /dev/null +++ b/infrastructure/Auth/AuthServiceProvider.php @@ -0,0 +1,41 @@ + 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + Passport::routes(function ($router) { + $router->forAccessTokens(); + // Uncomment for allowing personal access tokens + // $router->forPersonalAccessTokens(); + $router->forTransientTokens(); + }); + + Passport::tokensExpireIn(Carbon::now()->addMinutes(10)); + + Passport::refreshTokensExpireIn(Carbon::now()->addDays(10)); + } +} \ No newline at end of file -- cgit v1.2.3