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

@@ -1,11 +0,0 @@
framework:
asset_mapper:
# The paths to make available to the asset mapper.
paths:
- assets/
missing_import_mode: strict
when@prod:
framework:
asset_mapper:
missing_import_mode: warn

View File

@@ -1,20 +1,40 @@
security:
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
# comment sont hachés nos mots de passe
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
# d'où viennent nos utilisateurs ?
providers:
users_in_memory: { memory: null }
# used to reload user from session & other features (e.g. switch_user)
app_user_provider: # un nom unique
entity: # nos utilisateurs sont en base de données
class: App\Entity\User # c'est cette entité-là
property: email # représentée par cette propriété-ci
# activation du système de sécurité
firewalls:
# permet de désactiver sur la debug bar, le profiler, etc...
dev:
# Ensure dev tools and static assets are always allowed
pattern: ^/(_profiler|_wdt|assets|build)/
security: false
# notre pare-feu principal, activé partout par défaut
main:
lazy: true
provider: users_in_memory
provider: app_user_provider
# Le formulaire de connexion sera automatiquement protégé des attaques CSRF.
# La classe FormLoginAuthenticator est automatiquement utilisée en interne par Symfony,
# il n'y a plus de classe de type Authenticator à gérer soi-même.
form_login:
login_path: app_login
check_path: app_login
enable_csrf: true
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
# Activate different ways to authenticate:
# https://symfony.com/doc/current/security.html#the-firewall
@@ -23,6 +43,7 @@ security:
# switch_user: true
# Note: Only the *first* matching rule is applied
# autorisations
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }

View File

@@ -0,0 +1,45 @@
webpack_encore:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
# Set attributes that will be rendered on all script and link tags
script_attributes:
defer: true
# Uncomment (also under link_attributes) if using Turbo Drive
# https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change
# 'data-turbo-track': reload
# link_attributes:
# Uncomment if using Turbo Drive
# 'data-turbo-track': reload
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'
# Preload all rendered script and link tags automatically via the HTTP/2 Link header
# preload: true
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
# strict_mode: false
# If you have multiple builds:
# builds:
# frontend: '%kernel.project_dir%/public/frontend/build'
# pass the build name as the 3rd argument to the Twig functions
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
#when@prod:
# webpack_encore:
# # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# # Available in version 1.2
# cache: true
#when@test:
# webpack_encore:
# strict_mode: false