Sanctum not working with subdomain SPA with vue3 - performance

i am using sanctum with multiple subdomain dynamically created on user creation but when I am using test.localhost/project_name subdomain sanctum auth not working but when i am using localhost/project_name its working fine. i have added
SESSION_DOMAIN=.localhost
SANCTUM_STATEFUL_DOMAINS=umer.localhost:8000,umer.localhost:3000
but no any solution got. if you have any solution please share with me.

Related

Sanctum is not working with subdomains in multi-tenant [Tenancy for Laravel]

I am using Tenancy for Laravel but failing to use sanctum on subdomains as I have to define SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS wildcard or related to the Main domain.
Anyone can help me out.

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 properly on my local setup but in laravel forge it's saying I'm still Unaunthenticated
laravel forge domains
api.domain.com
frontend.domain.com
SESSION_DRIVER=cookie
SESSION_DOMAIN=.domain.com
SANCTUM_STATEFUL_DOMAINS=*.domain.com
Am I missing something?

Secure web routes with laravel passport token

I am newbie with laravel.
I understand that in order to protect routes, you have to first check if a user is authenticated and a session is made. thus, we apply auth middleware in the web routes.
However, I am trying to implement laravel passport and now I am not able to proceed to my routes anymore since I have been authenticated using the passport.
My question is that is it possible to secure the web routes with passport token instead of laravel session? and if so, how one should do it?
Thanks, sorry for english, not native speaker.
Laravel passport is for API routes not for web routes you can use laravel session for web
for more details read it's documentation
https://laravel.com/docs/8.x/passport

How do I make structure SPA and SSR with Laravel?

I'am using Laravel + Nuxt for current project.
Web app has user pages and admin pages.
user pages are working in Laravel + Nuxt SPA but admin pages should works on pure Laravel SSR.
I dont know how to make project structure.
Thank you in advance.
I found answer in this package
https://github.com/m2sd/nuxt-laravel
Main point is route web.php
It redirects SPA requests to Nuxt router
Admin dashboard router should be extracted into new file(ex. admin.php)
Correct answer is following to above article.

How should I authenticate in SPA using VueJS and Vue Router?

I am building a SPA website with Laravel for back-end and VueJS for front-end. And now I want to authenticate users in my website. So I used Laravel Passport for that. My question is that how should I keep user access token and refresh token in vue to make another requests for authentication required routes? Thanks in advance :)

Resources