在laravel5中使用postman获取token的时候遇到了一个与 laravel/passport 相关的新错误
Replicating claims as headers is deprecated and will removed from v4.0
我们“解决”了这个暂时将库 lcobucci/jwt 从 3.4.6 降级到 3.3.3 的问题。
方法:
composer require lcobucci/jwt 3.3.3 Info from https://repo.packagist.org: #StandWithUkraine ./composer.json has been updated Running composer update lcobucci/jwt Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals - Downgrading lcobucci/jwt (3.4.6 => 3.3.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 0 removals - Downloading lcobucci/jwt (3.3.3) - Downgrading lcobucci/jwt (3.4.6 => 3.3.3): Extracting archive Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead. Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead. Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead. Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files Carbon 1 is deprecated, see how to migrate to Carbon 2. https://carbon.nesbot.com/docs/#api-carbon-2 You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it. > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover Discovered Package: buzz/laravel-google-captcha Discovered Package: dcat/laravel-admin Discovered Package: fideloper/proxy Discovered Package: laravel/passport Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Package manifest generated successfully. 49 packages you are using are looking for funding. Use the `composer fund` command to find out more!
从上面的代码中可以看见lcobucci/jwt 的当前把版本是3.4.6。
降级后调试代码