jwt-auth icon indicating copy to clipboard operation
jwt-auth copied to clipboard

Upgrade to v2.0 with lcobucci/jwt 4.3.0 crash with package:discover

Open KhaledLela opened this issue 1 year ago β€’ 3 comments

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

KhaledLela avatar May 30 '23 13:05 KhaledLela

Same issue

trinvh avatar Jun 18 '23 14:06 trinvh

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!

KhaledLela avatar Jun 18 '23 16:06 KhaledLela

This probably won't get fixed. You can solve this by running composer as follow (on Linux) JWT_SECRET=DummySecret composer install

jonkerw85 avatar Jun 22 '23 07:06 jonkerw85