Added login flow to app controller and model