Base solution for your next web application
Open Closed

Go to application when user authorized #1683


User avatar
0
vitaly created

Hi Halil,

How to change behavior - if user authorzied - don't show front end page and redirect to application right away?


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can check AbpSession.UserId in HomeController's Index action. If it is bigger than 0, redirect user to ApplicationController's Index action.

  • User Avatar
    0
    vitaly created

    Could you give an example, please

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Change your HomeController's Index action to

    public ActionResult Index()
    {
        if (AbpSession.UserId > 0)
        {
            return RedirectToAction("Index", "Application");
        }
    
        return View();
    }
    
  • User Avatar
    0
    vitaly created

    Got it. Thank you