Open Closed

Start with Login Page #741


0
alukaszewski created

Hi, where do I configure to have the Mpa application start with the /Account/Login page? If I tick the 'remember me' option, should it then also take me straight into dashboard or still present the login page? Also, I am using Mpa only, so what sections/folders within Visual Studio can I safely remove from my project?


3 Answer(s)
  • 0
    hikalkan created
    Support Team

    Hi,

    where do I configure to have the Mpa application start with the /Account/Login page

    See <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App_Start/Startup.cs#L26">https://github.com/aspnetzero/aspnet-ze ... tup.cs#L26</a>

    If I tick the 'remember me' option, should it then also take me straight into dashboard or still present the login page?

    If remember me is checked and you loggin as like that. The next time you go the application, you are not redirected to the login page (unless you explicitly logout).

    I am using Mpa only, so what sections/folders within Visual Studio can I safely remove from my project

    You can remove the App folder and configure redirect to Mpa (see SPA OR MPA..? section in the document: <a class="postlink" href="http://www.aspnetzero.com/Documents/Getting-Started">http://www.aspnetzero.com/Documents/Getting-Started</a>).

    Have a nice day

  • 0
    alukaszewski created

    OK, maybe I asked my question incorrectly.

    When I access my published site in IIS, how do I have it start with the Login page instead of the default "Home page" page? My Startup.cs is already set with LoginPath = new PathString("/Account/Login").

    So, basically, I want the project to start with the Account Controller and not the Home Controller? Does that make sense?

  • 0
    alukaszewski created

    Aha! Found what I wanted. It was in the RoutConfig.cs, I changed:

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Callisto.Web.Controllers" }
                );
    

    to:

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional },
                namespaces: new[] { "Callisto.Web.Controllers" }
                );
    

    So many places to find things hidden away!

    Andy