security:
    password_hashers:
        Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'

    providers:
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            lazy: true
            provider: app_user_provider
            custom_authenticator: App\Security\UserAuthenticator

            form_login:
                login_path: app_login
                check_path: app_login

            logout:
                path: app_logout
                target: app_home # Redirect to homepage after logout

            remember_me:
                secret: '%kernel.secret%'
                lifetime: 604800 # 1 week
                path: /

            entry_point: form_login # Define the entry point as form_login to redirect unauthenticated users

    access_control:
        - { path: ^/admin, roles: ROLE_ADMIN, requires_channel: https }
        - { path: ^/login, roles: PUBLIC_ACCESS, requires_channel: https }
        - { path: ^/register, roles: PUBLIC_ACCESS, requires_channel: https }
        - { path: ^/logout, roles: PUBLIC_ACCESS, requires_channel: https }
        - { path: ^/wouldbe, roles: ROLE_WOULDBE, requires_channel: https }
        - { path: ^/, roles: ROLE_USER, requires_channel: https }

when@test:
    security:
        password_hashers:
            Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
                algorithm: auto
                cost: 4
                time_cost: 3
                memory_cost: 10