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

    providers:
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email  # c'est le champ qu'on utilise pour login

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            lazy: true
            provider: app_user_provider
            custom_authenticators:
                 - App\Security\LoginFormAuthenticator
                 - App\Security\OAuthAuthenticator
            login_throttling: true
            form_login:
                login_path: app_login
                check_path: app_login
            logout:
                path: app_logout
                target: app_login
            entry_point: App\Security\LoginFormAuthenticator
            custom_authenticator: App\Security\SocialAuthenticator

    access_control:
        # autoriser seulement les admins pour certaines pages
        - { path: ^/admin, roles: ROLE_ADMIN }
        # autoriser les utilisateurs connectés pour le dashboard
        - { path: ^/dashboard, roles: [ROLE_USER, ROLE_EMPLOYER, ROLE_ADMIN] }
