- 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)
-
0
hi
Please follow this https://github.com/abpframework/abp/issues/8794
-
0
Ok, I'll follow that. Apart from using the Index page to redirect, is there another way to set that startup page?
-
0
Hi, any progress on this?
-
0
hi
You can create a
WebAssemblyCurrentTenantAccessor
class to fix this.https://github.com/abpframework/abp/pull/8842
-
0
This question has been automatically marked as stale because it has not had recent activity.