I’m using sanctum for api, and all api run fine in localhost, but when run api in live server token doesn’t work, any route under “auth:sanctum” middleware redirect me to “Unauthenticated”, although i loged in, it loged in successfully and generate token, I passed “token” of the user in postman header, although it works fine in localhost, I tried alot
Tag: laravel-sanctum
Token expiration doesn’t working – Sanctum, Laravel
What I did: I added token expiration to application that has login system, by changed null to 1 minute expiration in sanctum.php file: Problem: It doesn’t work, the app still accept authorized requests all the time. Nothing has changed. Code: Create token (login): Verify token: Delete token (log out): Answer You might need to clear your config cache. Try to
Laravel Sanctum returns 500 when trying to access sanctum protected API
I am using Laravel 8.12 with PostgreSQL. I am trying to use Laravel Sanctum as authentication for my API. This is the schema for sanctum: And this is my user table: Now, when I try to send the token in headers, I get this error: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type uuid: “0” (SQL: select