progress in auth part

This commit is contained in:
Hesabix 2025-09-01 06:15:50 -04:00
parent 29b49d397d
commit 9a67d736dc
12 changed files with 13 additions and 13 deletions

View file

@ -1,9 +1,9 @@
<?php <?php
namespace App\Controller; namespace App\Controller\Auth;
use App\Entity\User; use App\Entity\User;
use App\Form\RegistrationFormType; use App\Form\Auth\RegistrationFormType;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -38,7 +38,7 @@ class RegistrationController extends AbstractController
$existingUser = $userRepository->findByEmail($user->getEmail()); $existingUser = $userRepository->findByEmail($user->getEmail());
if ($existingUser) { if ($existingUser) {
$this->addFlash('error', 'این ایمیل قبلاً ثبت شده است'); $this->addFlash('error', 'این ایمیل قبلاً ثبت شده است');
return $this->render('registration/register.html.twig', [ return $this->render('auth/registration/register.html.twig', [
'registrationForm' => $form->createView(), 'registrationForm' => $form->createView(),
]); ]);
} }
@ -46,7 +46,7 @@ class RegistrationController extends AbstractController
$existingUser = $userRepository->findByMobile($user->getMobile()); $existingUser = $userRepository->findByMobile($user->getMobile());
if ($existingUser) { if ($existingUser) {
$this->addFlash('error', 'این شماره موبایل قبلاً ثبت شده است'); $this->addFlash('error', 'این شماره موبایل قبلاً ثبت شده است');
return $this->render('registration/register.html.twig', [ return $this->render('auth/registration/register.html.twig', [
'registrationForm' => $form->createView(), 'registrationForm' => $form->createView(),
]); ]);
} }
@ -71,7 +71,7 @@ class RegistrationController extends AbstractController
return $this->redirectToRoute('app_login'); return $this->redirectToRoute('app_login');
} }
return $this->render('registration/register.html.twig', [ return $this->render('auth/registration/register.html.twig', [
'registrationForm' => $form->createView(), 'registrationForm' => $form->createView(),
]); ]);
} }

View file

@ -1,10 +1,10 @@
<?php <?php
namespace App\Controller; namespace App\Controller\Auth;
use App\Entity\User; use App\Entity\User;
use App\Form\ChangePasswordFormType; use App\Form\Auth\ChangePasswordFormType;
use App\Form\ResetPasswordRequestFormType; use App\Form\Auth\ResetPasswordRequestFormType;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Bridge\Twig\Mime\TemplatedEmail;
@ -42,7 +42,7 @@ class ResetPasswordController extends AbstractController
); );
} }
return $this->render('reset_password/request.html.twig', [ return $this->render('auth/reset_password/request.html.twig', [
'requestForm' => $form->createView(), 'requestForm' => $form->createView(),
]); ]);
} }
@ -51,7 +51,7 @@ class ResetPasswordController extends AbstractController
public function checkEmail(): Response public function checkEmail(): Response
{ {
// این صفحه فقط برای نمایش پیام استفاده می‌شود // این صفحه فقط برای نمایش پیام استفاده می‌شود
return $this->render('reset_password/check_email.html.twig'); return $this->render('auth/reset_password/check_email.html.twig');
} }
#[Route('/reset/{token}', name: 'app_reset_password')] #[Route('/reset/{token}', name: 'app_reset_password')]
@ -85,7 +85,7 @@ class ResetPasswordController extends AbstractController
return $this->redirectToRoute('app_login'); return $this->redirectToRoute('app_login');
} }
return $this->render('reset_password/reset.html.twig', [ return $this->render('auth/reset_password/reset.html.twig', [
'resetForm' => $form->createView(), 'resetForm' => $form->createView(),
]); ]);
} }

View file

@ -1,6 +1,6 @@
<?php <?php
namespace App\Controller; namespace App\Controller\Auth;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -20,7 +20,7 @@ class SecurityController extends AbstractController
$error = $authenticationUtils->getLastAuthenticationError(); $error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername(); $lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', [ return $this->render('auth/security/login.html.twig', [
'last_username' => $lastUsername, 'last_username' => $lastUsername,
'error' => $error, 'error' => $error,
]); ]);