Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KhaledLela opened this issue May 30, 2023 · 3 comments
Open

Comments

@KhaledLela
Copy link

KhaledLela commented May 30, 2023

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

@trinvh
Copy link

trinvh commented Jun 18, 2023

Same issue

@KhaledLela
Copy link
Author

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!

@jonkerw85
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants