Otvoriť Uzavreté

Different Startup Page for Tenant and Host #1225


User avatar
0
Leonardo.Willrich vytvorené
  • ABP Framework version: v4.3.0
  • UI type: Blazor
  • DB provider: EF Core

Hi,

Is there a way to have two different Startup pages, one for Tenant side (when user is logged as Tenant) and another one for Host side (when the user is logged as SaaS admin)?

I don't want to have the Home page, my main pages will be a different one.

How can I do that? I've tried to redirect from Index.razor, but the CurrentTenant.Id is always returning null.

public partial class Index
    {
        [Inject] public NavigationManager NavigationManager { get; set; }
        [Inject] ICurrentTenant CurrentTenant { get; set; }

        protected override void OnInitialized()
        {
            // https://support.abp.io/QA/Questions/1152/How-to-to-Login-page-when-accessing-the-app-and-after-logout
            // The CurrentUser.IsAuthenticated is not working properly, even if the user is logged, it redirects to login page
            
            if (!CurrentUser.IsAuthenticated)
            {
                Console.WriteLine("Redirecting to Login");
                NavigationManager.NavigateTo("/authentication/login");
            }
            
            // It doesn't work, CurrentTenantId is always Null
            /*
            if (CurrentTenant.Id.HasValue)
            {
                NavigationManager.NavigateTo("/outagereportmap");
            }
            else
            {
                NavigationManager.NavigateTo("/tenantactivity");
            }
            */
        }
    }

5 odpoveď(e)/dí
  • User Avatar
    0
    maliming vytvorené
    Tím podpory Fullstack Developer

    hi

    Please follow this https://github.com/abpframework/abp/issues/8794

  • User Avatar
    0
    Leonardo.Willrich vytvorené

    Ok, I'll follow that. Apart from using the Index page to redirect, is there another way to set that startup page?

  • User Avatar
    0
    Leonardo.Willrich vytvorené

    Hi, any progress on this?

  • User Avatar
    0
    maliming vytvorené
    Tím podpory Fullstack Developer

    hi

    You can create a WebAssemblyCurrentTenantAccessor class to fix this.

    https://github.com/abpframework/abp/pull/8842

  • User Avatar
    0
    ServiceBot vytvorené
    Tím podpory Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11