The problem is that my middleware is blocking all the requests that don’t have a valid token, but how should i do for a first authentification request that obviously dont have a token here’s my code if it helps :
Because the middleware is added to $app it applies for all routes, including the public ones. You can instead add the authorization middleware only to the specific routes that need authorization, for example by using [group middleware].