From 8164ca613ed101149b6cda8eed2995cadb08260b Mon Sep 17 00:00:00 2001 From: RBFraphael Date: Tue, 21 May 2024 17:15:26 -0300 Subject: [PATCH] Adds number parsing to ttl, refresh_ttl, blacklist_grace_period and leeway that comes from .env --- src/Providers/AbstractServiceProvider.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Providers/AbstractServiceProvider.php b/src/Providers/AbstractServiceProvider.php index 2d782c0e..ccf7dc59 100644 --- a/src/Providers/AbstractServiceProvider.php +++ b/src/Providers/AbstractServiceProvider.php @@ -279,8 +279,8 @@ protected function registerJWTBlacklist() $this->app->singleton('tymon.jwt.blacklist', function ($app) { $instance = new Blacklist($app['tymon.jwt.provider.storage']); - return $instance->setGracePeriod($this->config('blacklist_grace_period')) - ->setRefreshTTL($this->config('refresh_ttl')); + return $instance->setGracePeriod(intval($this->config('blacklist_grace_period'))) + ->setRefreshTTL(intval($this->config('refresh_ttl'))); }); } @@ -293,7 +293,7 @@ protected function registerPayloadValidator() { $this->app->singleton('tymon.jwt.validators.payload', function () { return (new PayloadValidator) - ->setRefreshTTL($this->config('refresh_ttl')) + ->setRefreshTTL(intval($this->config('refresh_ttl'))) ->setRequiredClaims($this->config('required_claims')); }); } @@ -309,8 +309,8 @@ protected function registerClaimFactory() $factory = new ClaimFactory($app['request']); $app->refresh('request', $factory, 'setRequest'); - return $factory->setTTL($this->config('ttl')) - ->setLeeway($this->config('leeway')); + return $factory->setTTL(intval($this->config('ttl'))) + ->setLeeway(intval($this->config('leeway'))); }); }