Laravel租赁子域在中央数据库中构成auth

发布于 2025-01-29 02:21:01 字数 330 浏览 1 评论 0 原文

我正在使用 stancl/租赁库。

我有一个中央域(example.com)和一个租户子域(tenant.example.com)。

问题在于,租户子域中的登录试图通过中央数据库进行验证。我有:

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

我已经几天检查配置了,一切似乎都很好。我对我会想念什么的想法吗?

谢谢你!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

大海や 2025-02-05 02:21:01

固定的!几乎总是发生,最大的问题来自最愚蠢的地方。

在某个时候,有人将ENV变量redis_client从 phpredis 更新为 predis

我必须在 .env 中设置 redis_client = phpredis

刷新缓存“ etvoilà!”。

我希望将来对某人有所帮助。

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.

想你的星星会说话 2025-02-05 02:21:01

我知道这与我的情况不同,但是我只是在这里为其他人呆了几乎一天,因为我使用了高个子预设,并且有Livewire,请确保您添加了LiveWire的特定更改 https://tenancyforlaravel.com/docs/docs/v3/integrations/livewire
而且不要忘记添加

i know it different case than mine , but I'm just puting this here for other people as I spent almost a day for it , because I used the tall presets , and there was livewire , make sure you add livewire specific changes https://tenancyforlaravel.com/docs/v3/integrations/livewire
and don't forget to add

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文