From 70ebc624a9b5702dd1c0843fe1281530a4146092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=A0pa=C4=8Dek?= Date: Wed, 15 May 2024 02:40:09 +0200 Subject: [PATCH] Auth fix --- src/Form/Type/LoginType.php | 29 +++++++++++++++++++++++++++++ templates/header.html.twig | 2 +- templates/login.html.twig | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/Form/Type/LoginType.php diff --git a/src/Form/Type/LoginType.php b/src/Form/Type/LoginType.php new file mode 100644 index 0000000..6a151bd --- /dev/null +++ b/src/Form/Type/LoginType.php @@ -0,0 +1,29 @@ +add('email', EmailType::class) + ->add('password', PasswordType::class); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => User::class, + ]); + } +} \ No newline at end of file diff --git a/templates/header.html.twig b/templates/header.html.twig index 608c7ea..dbe4a28 100644 --- a/templates/header.html.twig +++ b/templates/header.html.twig @@ -6,6 +6,6 @@ Charts
- Login + Login
diff --git a/templates/login.html.twig b/templates/login.html.twig index 06af37a..3f963af 100644 --- a/templates/login.html.twig +++ b/templates/login.html.twig @@ -8,7 +8,7 @@ {{ parent() }}
- {{ form_start(form, {'action': path('create'), 'method': 'POST'}) }} + {{ form_start(form, {'action': path('users_login'), 'method': 'POST'}) }} {{ form_widget(form) }}