Relative Content

Tag Archive for phplaraveljwt

jwt-auth redirect to home instead of 403

I;m using laravel 10.10 and tymon/jwt-auth library.
I have some routes that need to be auth token and some of my routes don’t need it (for example to get cities api).
I want to show 403 status header code when the user needs a token and it’s expired.

jwt-auth redirect to home instead of 403

I’m using tymon/jwt-auth library.
I have some routes that need to be auth token and some of my routes don’t need it (for example to get cities api).
I want to show 403 status header code when the user needs a token and it’s expired.

Как работает сервис для авторизации Sanctum?

есть задача разработать приложение, где должна присутствовать авторизация пользователя. Выбираю между JWT и Laravel Sanctum. Углубившись в тему понял как работает JWT, но не могу понять как работает Sanctum. Не пойму также почему кто-то говорит, что Sanctum безопаснее, чем JWT.