add login form and registration form #3

Closed
csimonis wants to merge 4 commits from feature/login into main
3 changed files with 26 additions and 2 deletions
Showing only changes of commit 51c5e9ac57 - Show all commits

View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
#[Route(path: '/', name: 'app_home', methods: Request::METHOD_GET)]
public function __invoke(): Response
{
return $this->render('home/index.html.twig');
}
}

View File

@ -10,7 +10,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController class SecurityController extends AbstractController
{ {
#[Route(path: '/login', name: 'app_login')] #[Route(path: '/login', name: 'app_login', methods: [Request::METHOD_GET, Request::METHOD_POST])]
public function login(AuthenticationUtils $authenticationUtils): Response public function login(AuthenticationUtils $authenticationUtils): Response
{ {
return $this->render('security/login.html.twig', [ return $this->render('security/login.html.twig', [
@ -19,7 +19,7 @@ class SecurityController extends AbstractController
]); ]);
} }
#[Route(path: '/logout', name: 'app_logout')] #[Route(path: '/logout', name: 'app_logout', methods: Request::METHOD_GET)]
public function logout(): void public function logout(): void
{ {
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');

View File

@ -0,0 +1,7 @@
{% extends 'base.html.twig' %}
{% block title %}Home!{% endblock %}
{% block body %}
Home
{% endblock %}