mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-07 05:04:20 +01:00
Refactor Base64 encoding/decoding methods for consistency, update controller routes, and improve CI configuration
This commit is contained in:
@@ -8,7 +8,6 @@ use App\Entity\Quiz;
|
||||
use App\Entity\Season;
|
||||
use App\Repository\CandidateRepository;
|
||||
use App\Repository\SeasonRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
@@ -6,9 +6,11 @@ namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
#[AsController]
|
||||
class LoginController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/login', name: 'app_login_login')]
|
||||
|
||||
21
src/Controller/PrepareEliminationController.php
Normal file
21
src/Controller/PrepareEliminationController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route(path: '/backoffice/elimination')]
|
||||
final class PrepareEliminationController extends AbstractController
|
||||
{
|
||||
#[Route('/prepare', name: 'app_prepare_elimination')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('prepare_elimination/index.html.twig', [
|
||||
'controller_name' => 'PrepareEliminationController',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ final class QuizController extends AbstractController
|
||||
$data = $form->getData();
|
||||
$name = $data['name'];
|
||||
|
||||
return $this->redirectToRoute('app_quiz_quizpage', ['seasonCode' => $season->getSeasonCode(), 'nameHash' => Base64::base64_url_encode($name)]);
|
||||
return $this->redirectToRoute('app_quiz_quizpage', ['seasonCode' => $season->getSeasonCode(), 'nameHash' => Base64::base64UrlEncode($name)]);
|
||||
}
|
||||
|
||||
return $this->render('quiz/enter_name.twig', ['season' => $season, 'form' => $form]);
|
||||
@@ -90,7 +90,7 @@ final class QuizController extends AbstractController
|
||||
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $season->getSeasonCode()]);
|
||||
}
|
||||
|
||||
$candidate = new Candidate(Base64::base64_url_decode($nameHash));
|
||||
$candidate = new Candidate(Base64::base64UrlDecode($nameHash));
|
||||
$candidateRepository->save($candidate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user