jwt-auth
jwt-auth copied to clipboard
Upgrade to v2.0 with lcobucci/jwt 4.3.0 crash with package:discover
Subject of the issue
Describe your issue here.
Your environment
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Framework | Laravel |
Framework version | 9.52.4 |
Package version | 2.0 |
PHP version | 8.2.6 |
Steps to reproduce
Tell us how to reproduce this issue. $ composer install
- Upgrading lcobucci/jwt (4.2.1 => 4.3.0): Extracting archive
- Installing tymon/jwt-auth (2.0.0): Extracting archive
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Tymon\JWTAuth\Exceptions\JWTException
Secret is not set.
at vendor/tymon/jwt-auth/src/Providers/JWT/Lcobucci.php:244
240β return $this->getKey($privateKey, $this->getPassphrase() ?? '');
241β }
242β
243β if (! $secret = $this->getSecret()) {
β 244β throw new JWTException('Secret is not set.');
245β }
246β
247β return $this->getKey($secret);
248β }
+35 vendor frames
36 app/Exceptions/Handler.php:72
Illuminate\Auth\AuthManager::__call()
+3 vendor frames
40 [internal]:0
Illuminate\Foundation\Bootstrap\HandleExceptions::Illuminate\Foundation\Bootstrap\{closure}()
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
Expected behaviour
Tell us what should happen
Actual behaviour
Tell us what happens instead
Same issue
This issue was php artisan package:discover
requires existence of .env
, That fix the issue for me.
But for me it doesnβt make sense specially during pipeline deployment!
This probably won't get fixed. You can solve this by running composer as follow (on Linux)
JWT_SECRET=DummySecret composer install