0
alper created
Support Team
Director
Project: MVC + Tiered. I want to skip the /Index page and route to Login page and after the successfull login, I wan to route to the Dashboard page.
1 Answer(s)
-
0
Change your
Index.cshtml.cs
tousing System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Mvc; namespace Mvc.Tiered1.Web.Pages { public class IndexModel : Tiered1PageModel { public async Task<IActionResult> OnGetAsync() { return RedirectToPage(CurrentUser.TenantId.HasValue ? "/TenantDashboard" : "/HostDashboard"); } public async Task OnPostLoginAsync() { await HttpContext.ChallengeAsync("oidc"); } } }