laravel-sanctum

CSRF token mismatch Laravel sanctum and Angular http

廉价感情. 提交于 2020-06-01 05:36:50
问题 I have been trying to implement Laravel sanctum, but I am having this error "CSRF token mismatch" even though I followed everything that is said in the Laravel Sanctum documentation cors.php config file 'paths' => [ 'api/*', 'login', 'logout', 'sanctum/csrf-cookie' ], 'supports_credentials' => true, kernal is added as per the documentation, so not wasting space by adding its code here .env file SESSION_DRIVER=cookie SESSION_DOMAIN=localhost SANCTUM_STATEFUL_DOMAINS=localhost I am using

Laravel Vue SPA using Sanctum response Unauthorized

£可爱£侵袭症+ 提交于 2020-04-30 07:14:08
问题 The Sanctum Auth system on my local machine works well and I have no errors. But my deployed app is having trouble with authorizing a user. When I login it sends a request to get the user data then redirects. After auth completes you are redirected and the app make a GET request for more data. This GET route is guarded using laravel sanctum. But the backend is not registering that the user has made a successful login attempt so it sends a 401 Unauthorized error. Here is some code... loadUser