Register->Login page->Home page



I am trying to redirect to the login page when register is done if verification is not required.

in the last part of register() in AccountController.php 
else {
 // No verification required
    $ms->addMessageTranslated('success', 'REGISTRATION.COMPLETE_TYPE1');
    return $this->ci->view->render($response, 'pages/sign-in.html.twig'); 
    //I added above line but it's not working.

Also I want to redirect to root url after login instead of dash board. Would you give me a tip to do it?



More something like this would be appropriate:

return $response->withRedirect($loginPage);


EDIT: it depends on the scope of where you are how to exactly do this.