feat: creation de l'entité USER de façon sécurisée (cf mon cours) + installation de Tailwind sur le projet + première ébauche d'une page de connexion

This commit is contained in:
2026-03-16 10:03:57 +01:00
parent 1454b9bfc8
commit 38b1293a27
30 changed files with 8159 additions and 263 deletions

View File

@@ -5,10 +5,10 @@
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
{% block stylesheets %}
<link rel="stylesheet" href="/assets/styles/app.css">
{% endblock %}
{% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
{% endblock %}
</head>
<body>

View File

@@ -0,0 +1,39 @@
{% extends 'base.html.twig' %}
{% block title %}Log in!{% endblock %}
{% block body %}
<form method="post">
{% if error %}
<div class="p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 border border-red-200">
Email ou mot de passe invalide.
</div>
{% endif %}
{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ logout_path() }}">Se déconnecter</a>
</div>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal">Se connecter à mon compte KAZ</h1>
<label for="username">Email</label>
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
<label for="password">Mot de passe</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
{# TODO : vérifier qu'il y a bien une option "Se souvenir de moi" dans mon firewall pour activer la fonctionnalité. #}
{# pour en savoir plus : https://symfony.com/doc/current/security/remember_me.html #}
<div class="checkbox mb-3">
<input type="checkbox" name="_remember_me" id="_remember_me">
<label for="_remember_me">Se souvenir de moi</label>
</div>
<button class="btn btn-lg btn-primary" type="submit">
Se connecter
</button>
</form>
{% endblock %}