The session will have the form key, no need to inject it into the template.
This commit is contained in:
parent
8a936fc2f7
commit
4477962d3a
@ -8,13 +8,8 @@ use Slovocast\Handler\Handler;
|
|||||||
|
|
||||||
class CreateChannelPage extends Handler
|
class CreateChannelPage extends Handler
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private SessionInterface $session
|
|
||||||
) { }
|
|
||||||
|
|
||||||
public function handle(): Response
|
public function handle(): Response
|
||||||
{
|
{
|
||||||
$formKey = $this->session->get("form_key");
|
|
||||||
return $this->render('channel/create.twig', [ 'form_key' => $formKey ]);
|
return $this->render('channel/create.twig', [ 'form_key' => $formKey ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,8 @@ use Slovocast\Handler\Handler;
|
|||||||
|
|
||||||
class LoginUserPage extends Handler
|
class LoginUserPage extends Handler
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private SessionInterface $session
|
|
||||||
) { }
|
|
||||||
|
|
||||||
public function handle(): Response
|
public function handle(): Response
|
||||||
{
|
{
|
||||||
$formKey = $this->session->get("form_key");
|
|
||||||
return $this->render('user/login.twig');
|
return $this->render('user/login.twig');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,8 @@ use Slovocast\Handler\Handler;
|
|||||||
|
|
||||||
class RegisterUserPage extends Handler
|
class RegisterUserPage extends Handler
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private SessionInterface $session
|
|
||||||
) { }
|
|
||||||
|
|
||||||
public function handle(): Response
|
public function handle(): Response
|
||||||
{
|
{
|
||||||
$formKey = $this->session->get("form_key");
|
|
||||||
return $this->render('user/register.twig', [ 'form_key' => $formKey ]);
|
return $this->render('user/register.twig', [ 'form_key' => $formKey ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div>
|
<div>
|
||||||
<form action="/login" method="post">
|
<form action="/login" method="post">
|
||||||
|
<input name="form_key" type="hidden" value="{{ session.get('form_key') }}"
|
||||||
<div>
|
<div>
|
||||||
<label for="email">Email<br>
|
<label for="email">Email<br>
|
||||||
<input name="email" type="text" required>
|
<input name="email" type="text" required>
|
||||||
|
Loading…
Reference in New Issue
Block a user