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

ergezcaner's avatar

JWT redirect middleware

I use cURL requests . And ı use JWT Token .

Plugin : https://github.com/tymondesigns/jwt-auth

$this->middleware('auth:api', ['except' => ['login']]);

If I use this code in the constructor method, the page is refreshed in the intermediate layer and it leads to the login page.

If I do not use it I am logged in as it is, but Auth :: id (); function does not return results.

0 likes
0 replies

Please or to participate in this conversation.