spatie / laravel-multitenancy

Make your Laravel app usable by multiple tenants
https://spatie.be/docs/laravel-multitenancy
MIT License
1.11k stars 153 forks source link

Session store not set on request #556

Closed sbc640964 closed 2 months ago

sbc640964 commented 2 months ago

Hi

I use with EnsureValidTenantSession middleware on api routes and laravel throws error "Session store not set on request".

I see this, because the API request (with sanctom tokens) does'nt store the session in requests.

and EnsureValidTenantSession file contains this: $request->session() in line: 17 and more

masterix21 commented 2 months ago

Hi @sbc640964.

Your message has the answer: remove the EnsureValidTenantSession from the API because your token guarantees the tenant.

sbc640964 commented 2 months ago

@masterix21, I mean the route that has a tenant (subdomain)

masterix21 commented 2 months ago

Please explain better your issue. Thanks