Skip to content

Commit cd7b5ed

Browse files
committed
Passport: Token lifetimes
1 parent 5b60c20 commit cd7b5ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Providers/AuthServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Providers;
44

5+
use Carbon\Carbon;
56
use HMS\Auth\PasswordStore;
67
use HMS\Auth\HmsUserProvider;
78
use Laravel\Passport\Passport;
@@ -33,6 +34,9 @@ public function boot(EntityManagerInterface $em, PasswordStore $passwordStore)
3334
return new HmsUserProvider($app['hash'], $em, $config['model'], $passwordStore);
3435
});
3536

37+
// Passport bits.
3638
Passport::routes();
39+
Passport::tokensExpireIn(Carbon::now()->addDays(15));
40+
Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
3741
}
3842
}

0 commit comments

Comments
 (0)