diff --git a/app/openapi/middleware/Auth.php b/app/openapi/middleware/Auth.php index 5df2c101..5b439684 100644 --- a/app/openapi/middleware/Auth.php +++ b/app/openapi/middleware/Auth.php @@ -19,7 +19,10 @@ class Auth public function handle($request, \Closure $next) { try { - $oauth = new OAuth2(new OAuthStorage); + $oauth = new OAuth2(new OAuthStorage, [ + 'access_token_lifetime' => env('OPENAPI.ACCESS_TOKEN_LIFETIME', 3600), + 'refresh_token_lifetime' => env('OPENAPI.REFRESH_TOKEN_LIFETIME', 1209600), + ]); $token = $oauth->getBearerToken(); $oauth->verifyAccessToken($token); } catch (OAuth2ServerException $e) {