Open Closed

Question on Tenant Resolving #5747


User avatar
0
balessi75 created

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)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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

  • User Avatar
    0
    balessi75 created

    Thanks as always @maliming

    This was very helpful!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You're welcome. : )

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19