laravel-sanctum Questions

4

I am trying to get the current user in my laravel vue application. And whenever I trie to get it i am getting this error: Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login]...
Nuncle asked 12/10, 2021 at 0:21

4

Currently I am building rest API using Laravel. For authentication, I am using the Sanctum package. Every time a user is logged in it generate a token that looks like this: "token": &quot...
Region asked 7/9, 2021 at 6:37

5

Solved

I have a fresh installation of Laravel Sanctum API. When I try to log a user in after registration or when submitting the registration form twice, I get an exception with the message "The rout...
Vallee asked 3/1, 2023 at 1:59

16

I am using Laravel sanctum in my project with angular as frontend. Getting unauthenticated from the second api request. Please let me know where am I going wrong Frontend-> 127.0.0.1:4200 Backend...
Overmatch asked 25/3, 2020 at 4:47

4

Solved

I am using laravel sanctum in my project, but I am facing a problem. I want to customize the 401 response code (unauthorized) to return a JSON when a token is invalid, something like this: { &quo...
Glare asked 25/7, 2021 at 7:0

1

I have 3 Laravel applications, one running on Laravel 6 and 2 running on Laravel 8. They all uses Vue and JWT auth from tymondesigns, and I've plan to upgrade them all to Laravel 10. But after I su...
Hyperbolic asked 7/3, 2023 at 2:25

4

Solved

I get a "419 (unknown status)" error with the message "CSRF token mismatch." POST http://127.0.0.1:8000/login 419 (unknown status) CSRF token mismatch. Laravel server : http://1...
Lenhard asked 21/8, 2021 at 19:22

2

Solved

I have integrated sanctum for API authentication. I was facing a problem of redirection if the token is unauthenticated and solved it using this answer on laracasts I could get a JSON response like...
Assembler asked 16/3, 2022 at 15:19

2

Frontend: localhost:3002 Backend: sanctum.local How to config these two fields in the env file: SANCTUM_STATEFUL_DOMAINS= SESSION_DOMAIN= when I try to login I get 419 unknown status.
Miracidium asked 15/10, 2020 at 17:8

11

I am using Laravel Sanctum with Vuejs SPA. Both reside on same top level domain Laravel backend : app.demo.localhost Vue SPA : app-spa.demo.localhost Login and logout (endpoints) are working cor...
Warnke asked 25/4, 2020 at 5:53

4

I have a NextJS Frontend with Next-Auth installed and a Laravel Backend using Sanctum When I try to login using the signIn function of Next-Auth, it gives me this error: Request failed with status ...
Chronological asked 13/11, 2021 at 21:14

11

I was using Laravel's built-in api token authentication before but I wanted to provide multiple api tokens for different clients and with Laravel 7.x, I'm trying to migrate to Laravel Sanctum. API ...
Sibyl asked 16/7, 2020 at 19:13

5

Solved

I'm using Laravel 7 with Sanctum authentication for my app. How can i implement the logout procedure? I use: Auth::user()->tokens()->delete(); and it works, but It delete all tokens of this ...
Scan asked 21/6, 2020 at 9:53

6

I follow the Laravel official document step by step. When I send a request to {{host}}/api/login, I can receive the response that includes the token. Everything is correct. But when I try to send a...
Maciemaciel asked 3/5, 2021 at 6:20

2

I'm using nuxt 3 for a project and can't find an easy way to do authentication with Laravel and Sanctum. The @nuxtjs/axios module is only compatible for nuxt 2 and the package a developer provided ...
Quaternion asked 25/11, 2022 at 10:34

5

Solved

I am currently learning Laravel (which is not going particularly smoothly) and I have got a couple of routes configured to test authentication using sanctum. I am building an API only Laravel servi...
Facilitation asked 14/6, 2021 at 13:1

2

Solved

I'm using Laravel Sanctum to authenticate users. I'd like to have a route that can be accessed by guests and logged in users. Logged in users send an API Token in the Authorization header. I've tri...
Taverner asked 10/11, 2021 at 21:56

3

I installed L8, Sanctum, and Fortify for authentication. I was able to /login (used a Pre-request Script to set the X-XSRF-TOKEN). I even get the /api/user successfully. But when I do /logout, I ge...
Strychnine asked 1/3, 2021 at 15:45

4

When I run $user->currentAccessToken()->delete(); the token expires, Auth::check() becomes false, what it is expected. However, when I go to the personal_access_tokens table, the token is sti...
Menswear asked 29/9, 2020 at 9:47

10

package: Sanctum After generate token when request for get data its throw me error like this Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'api_token'...
Lookin asked 10/4, 2020 at 13:21

8

I'm testing with laravel sanctum but here some issues.. I'm creating Admin guard. When I change the middleware to auth:sanctum_admin.. it should be only can access by admin but here I can access...
Czardom asked 12/4, 2020 at 11:24

4

I am using laravel sanctum SPA authentication in my Vue project.Everything is working well but even after logout Auth::logout() I am still able to get datas from api route inside middleware Route:...

6

i really need help with one little thing I try to do. I try to use concurrent personal_access_tokens in my laravel / Vue setup for one user. Everything is working fine, all but one thing where I wa...
Chinookan asked 5/7, 2021 at 11:15

3

Solved

Can Laravel Fortify be used in the context of API? From what I understand, Fortify (although being headless, i.e. doesn't include a UI layer) allows us to customize Login and Register pages, but it...
Privative asked 24/9, 2020 at 4:58

1

Solved

I have set the sanctum token expiration in the config file, for let's say 24 hours: /* |-------------------------------------------------------------------------- | Expiration Minutes |------------...
Hickie asked 27/7, 2022 at 9:50

© 2022 - 2025 — McMap. All rights reserved.