Starts in:
1 DAY
13 HRS
14 MIN
45 SEC
Starts in:
1 D
13 H
14 M
45 S
Open Closed

Different Startup Page for Tenant and Host #1225


User avatar
0
Leonardo.Willrich created
  • 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 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

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

  • User Avatar
    0
    Leonardo.Willrich created

    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 created

    Hi, any progress on this?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can create a WebAssemblyCurrentTenantAccessor class to fix this.

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

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

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

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06