Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

niclm's avatar
Level 9

401 Unauthorised API errors after upgrading from ^6.2 to ^7.0

I have just upgraded Laravel and all my API routes are returning a 41 unauthorised error despite successfully logging in.

I did follow this upgrade documentation: https://laravel.com/docs/7.x/upgrade

PS: I am using Passports CreateFreshApiToken class in my web middleware.

Any ideas ? 🤔

0 likes
4 replies
robertldeboer's avatar

Refresh your config cache? You could try regenerating the passport key or clients

niclm's avatar
Level 9

We have also released Passport 9.3.2 to provide compatibility with today's releases. If you are running Passport on Laravel 6.x or 7.x, you should update to today's Passport 9.3.2 release. The Passport release is not a security release; however, the library needed updates to be compatible with today's framework changes.

https://blog.laravel.com/laravel-cookie-security-releases

Please or to participate in this conversation.