If login is successful, the view redirects to the URL specified in next