security:
    encoders:
        App\Entity\User:
            algorithm: auto

    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: true
            lazy: true
            provider: app_user_provider
            guard:
                authenticators:
                    - App\Security\LoginAuthenticator
            logout:
                path: app_logout

    access_control:
        - { path: ^/login-redirect, roles: "ROLE_USER" }
        - { path: ^/mon-espace, roles: "ROLE_CLUB" }
        - { path: ^/admin, roles: "ROLE_ADMIN" }

    access_denied_url: /login-redirect
