Create everything required to login and register

This commit is contained in:
Tim
2023-04-02 19:34:00 +02:00
parent 82d5625e60
commit 5be77eeba1
26 changed files with 1664 additions and 55 deletions

View File

@ -5,7 +5,7 @@ security:
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers:
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
user_provider:
entity:
class: App\Entity\User
property: username
@ -15,7 +15,19 @@ security:
security: false
main:
lazy: true
provider: app_user_provider
provider: user_provider
logout:
path: logout
form_login:
login_path: login
check_path: login
remember_me:
secret: '%kernel.secret%' # required
lifetime: 2419200 # 4 weeks in seconds
secured_area:
form_login:
enable_csrf: true
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
@ -26,8 +38,12 @@ security:
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
- { path: ^/login$, role: PUBLIC_ACCESS }
- { path: ^/logout$, role: ROLE_USER }
- { path: ^/register, role: ROLE_ADMIN }
- { path: ^/admin, role: ROLE_ADMIN }
- { path: ^/, role: ROLE_USER }
when@test:
security: