ABP Commercial 7.2.1 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme
Hi,
We have successfully implemented a sub domain based tenant resolver by inheriting from TenantResolveContributorBase
and overriding the ResolveAsync
method.
When a subdomain for the tenant cannot be resolved (invalid subdomain entered in the URL), we are currently throwing a BusinessException
which renders a plain text message on an empty page for the user.
How can we redirect the user to a specific error page in our project from within the ResolveAsync
method? Our implementation of the tenant resolver is in the domain project of our Blazor Server solution.
Any recommendations are greatly appreciated.
-Brian
3 Answer(s)
-
0
hi
You can redirect page in custom
MultiTenancyMiddlewareErrorPageBuilder
.The MultiTenancyMiddlewareErrorPageBuilder is used to handle inactive and non-existent tenants.
It will respond to an error page by default, you can change it if you want, eg: only output the error log and continue ASP NET Core's request pipeline.
https://docs.abp.io/en/abp/latest/Multi-Tenancy
-
0
Thanks as always @maliming
This was very helpful!
-
0
You're welcome. : )