<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
/**
*
* @author "wendell.zheng <wxzheng@ustc.edu.cn>"
*/
class SecurityController extends AbstractController
{
/**
*
* @Route("/review/login", name="review_login")
*/
public function reviewLogin(Request $request, AuthenticationUtils $authUtils): Response
{
$error = $authUtils->getLastAuthenticationError();
$lastUsername = $authUtils->getLastUsername();
return $this->render('security/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error
]);
}
/**
*
* @Route("/review/logout", name="review_logout")
*/
public function reviewLogout(): void
{
throw new \Exception('Don\'t forget to activate logout in security.yaml');
}
/**
*
* @Route("/cas/logout", name="cas_logout")
*/
public function casLogout(): void
{
throw new \Exception('Don\'t forget to activate logout in security.yaml');
}
}