You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with Laravel 8.x, the TrustHost middleware is enabled by default. See laravel/laravel#5477 This breaks Domain-based tenant identification since these requests will be treated as 'untrusted' unless added as a trusted host. This does not affect subdomain identification as sub-domains are added to the trusted hosts by default.
This took hours of debugging since the only error displayed with this middleware is 404 with no additional context.
Either disabling this TrustHost middleware entirely (pre-8.0 functionality), or adding the custom tenant domains in the public hosts() method, solves this issue.
To be clear, this is not a bug or issue with this package -- but rather a suggestion to include a line in the documentation. Will submit a PR in the docs repo when I get some extra time. But, in the meantime hopefully this saves others time.
Steps to reproduce
Fresh Laravel 8.x install
Use Domain-based tenant identification
Get 404
Expected behavior
Tenants are identified by domain
Your setup
Laravel version: 8.1.2
stancl/tenancy version: 3.4
The text was updated successfully, but these errors were encountered:
Describe the bug
Starting with Laravel 8.x, the TrustHost middleware is enabled by default. See laravel/laravel#5477 This breaks Domain-based tenant identification since these requests will be treated as 'untrusted' unless added as a trusted host. This does not affect subdomain identification as sub-domains are added to the trusted hosts by default.
This took hours of debugging since the only error displayed with this middleware is 404 with no additional context.
Either disabling this TrustHost middleware entirely (pre-8.0 functionality), or adding the custom tenant domains in the public
hosts()
method, solves this issue.To be clear, this is not a bug or issue with this package -- but rather a suggestion to include a line in the documentation. Will submit a PR in the docs repo when I get some extra time. But, in the meantime hopefully this saves others time.
Steps to reproduce
Expected behavior
Tenants are identified by domain
Your setup
The text was updated successfully, but these errors were encountered: