Questions tagged [sanctum]
65 questions
0
votes
0 answers
Laravel Angular project setup on heroku cookie issue
I have setup this two app to work together
https://admin-angular-app.herokuapp.com/login (Angular App)
https://lara-admin-999.herokuapp.com/ (Laravel App)
Now when I run the angular app due to subdomain cookies it is not working as expected.
How I…

Mithilesh Jha
- 175
- 1
- 11
0
votes
1 answer
Laravel-Authentication: Passport vs Sanctum
I am new to Laravel and for practicing I am trying to create a website like GoFundMe but simpler with Laravel and Vue js.
But am very confused with Laravel's authentication systems, even though I have read most of the questions here.
Which…

aliana
- 47
- 5
0
votes
0 answers
Nuxt with Sanctum : $auth and cookie deleted after refresh
I have a problem with the authenticate with my Nuxt application (static SSR).
I'm using Sanctum. But the $auth variable is emptied after a refresh. So the user is disconnected.
login.vue
await…

Vin Parker
- 93
- 9
0
votes
0 answers
laravel sanctum nuxt auth request validation
When authorizing on the site through nuxt, I want to process the server response, I don’t know how to do it.
I have different responses from the server, the user is not found, the password is wrong, the user is blocked, and other. So how to get…

Cdevelop
- 65
- 5
0
votes
1 answer
Set different santum token expiration base on user role using laravel
I know I can set sanctum token expiration time in config/sanctum.php but this expiration seems to be global. How can I set a different expiration time base on their role. e.g super admin token should expire after 30 minutes while admin should expire…

emmy felico
- 31
- 1
- 2
- 9
0
votes
0 answers
Laravel Sanctum unauthenticated / token not saved
I have a Laravel 6 application and installed Laravel Sanctum. Have followed these steps [1]. If I run sanctum/token via Postman I get a token as a response. When I open a protected route with this token set as bearer I always get…

Joost
- 87
- 2
- 5
0
votes
1 answer
Nuxt.js / Sanctum : $auth.user still empty
Little question: my authentication with Sanctum has issues...
My login fonction:
const response = await axios.get(`${process.env.apiUrl}/sanctum/csrf-cookie`)
console.log(response)
const res = await this.$auth.loginWith('laravelSanctum', {
data:…

Vin Parker
- 93
- 9
0
votes
1 answer
How to manage multiple connection on laravel sanctum package?
We are working on project where multiple databases are connected. We have created connections i.e. dbconnection1 and api. We are facing problem in connecting sanctum auth to different connection i.e. api after upgrading Laravel to 9.
Earlier it was…

HK Softtronix
- 3
- 2
0
votes
1 answer
Laravel Sanctum custom model throwing unkown column when exectuting createToken
I am using Laravel Sanctum and have customised the model (followed the config here: https://laravel.com/docs/9.x/sanctum#overriding-default-models).
Currently my model is structured like…

Rickin Rathatha
- 157
- 1
- 2
- 15
0
votes
0 answers
laravel fortify sanctum SPA issues on forge
My setup is working properly locally but apparently I'm getting a 401 issue on laravel forge for my laravel-fortify-sanctum
basically I use laravel fortify for authentication then sanctum to get a token after authentication process.
it works…

tom_cruz
- 411
- 1
- 6
- 15
0
votes
0 answers
How to obtain new access token without login laravel sanctum?
I made a login api using Laravel Sanctum for the front end, the token only expires for 15 minutes. If it expires, the front end user must log back in to get a new token. For reactjs developer, how do you get a new token without having to log in…

Ibrahim Ahmad
- 109
- 1
- 8
0
votes
2 answers
How get access token after autorization laravel sanctum?
Hello i'm newbie in laravel. I use for authorization sanctum. But i want that some request can available for authorization user (i use laravel for only api, on front i use angular 2).
web.php:
Route::group(['middleware' => ['auth:sanctum']],…

данил куролесов
- 71
- 1
- 7
-1
votes
2 answers
login issue with Laravel and Sanctum
I have an issue with the login, I'm pretty sure to enter the good login information but I have the error message 401 i DONT understand why please someone help me
enter image description here
I expect to understand why i have the bad answers even I…
-1
votes
1 answer
In ConnectionFactory.php line 274: Unsupported driver [mongodb]
I installed sanctum in my comany project (laravel9). when I used the command "php artisan migrate" it errored "In ConnectionFactory.php line 274: Unsupported driver [mongodb]".
While i use mysql and in my .env file the database is mysql. this is the…

Sahar Parsaifar
- 11
- 3
-1
votes
1 answer
CSRF Cookie is not being set when using axios GET - Laravel 9 Sanctum
I am currently trying to create a simple authentication feature using Laravel (v9.52.4) and Sanctum. From the frontend I am currently using Axios to get and post data. Both frontend and backend API are running on localhost (http://121.0.0.1:8000)…

torokakos98
- 1
- 1