Open Closed

Not able to change the default landing Home page. #6361


User avatar
0
hashmi1979 created

Hi Team, I am new to ABP, I am not able to change the default landing page of MVC application. when I run the application its showing Home Page with ABP Documentation, I want the default page to be the Login page. I looked everywhere and could not find the place where the default is configured.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can update the IndexModel class:

    public class IndexModel : ....
    {
        public IActionResult OnGet()
        {
            if(!CurrentUser.IsAuthenticated)
            {
                return RedirectToPage("/Account/Login");
            }
            
            return Page();
        }
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09