public function getLogin(Request $request, $resetCookies = false)
{
$user = $this->getUser();
if ($user && $user->getEnabled() == 1) {
$response = $this->redirectToRoute('dashboard');
$token = $this->session()->get('authentication');
$this->setAuthenticationCookie($request, $response, $token);
return $response;
}
if ($this->getOption('general/enforce_ssl') && !$request->isSecure()) {
return $this->redirect(preg_replace('/^http:/i', 'https:', $request->getUri()));
}
$response = $this->render('@bolt/login/login.twig', ['randomquote' => true]);
$response->setVary('Cookies', false)->setMaxAge(0)->setPrivate();
if ($resetCookies) {
$response->headers->clearCookie($this->app['token.authentication.name']);
}
return $response;
}