laravel-api-boilerplate icon indicating copy to clipboard operation
laravel-api-boilerplate copied to clipboard

Inconsistent behavior for GET token endpoint

Open tvarga94 opened this issue 6 months ago • 1 comments

Hello.

When calling the GET /api/auth/jwt/token endpoint, I’m experiencing inconsistent behavior. The endpoint is expected to issue a JWT token for authentication, but instead, it is being treated as a GET request, which doesn’t align with typical login flows (which should usually be a POST request).

In my opinion the correct behavior for generating a JWT token would be to use a POST request, not GET. Therefore, it would be better to update the API method to use POST /api/auth/jwt/token instead of GET. The same goes for the /refresh.

Is there a specific reason why its a GET?

Feel free to correct me if I miss something. Looking forward to the answer, Br, Tamas

tvarga94 avatar Apr 13 '25 12:04 tvarga94