laravel tenancy subdomain makes Auth in central database

Viewed 366

I'm using stancl/tenancy library.

I have a central domain (example.com) and a tenant subdomain (tenant.example.com).

The problem is that the login in the tenant subdomain is trying to auth through central database. I have:

dd(tenant()); // this shows the right tenant
Auth::attempt($credentials_array); // this tries to auth in central database

I've been a couple of days checking configuration and everything seems to work fine. Any idea of what could I be missing?

Thank you!

1 Answers

Fixed! As almost always happens, the biggest problems comes from the dumbest places.

At some point someone updated the env variable REDIS_CLIENT from phpredis to predis.

I had to set REDIS_CLIENT=phpredis in the .env.

refresh cache "et voilĂ !".

I hope this helps someone in the future.

Related