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|assets|build)/
            security: false
        main:
            lazy: true
            provider: app_user_provider
            form_login:
                login_path: app_login
                check_path: app_login
                default_target_path: app_mapa
                enable_csrf: true
            logout:
                path: app_logout
                target: app_inicio
            remember_me:
                secret: '%kernel.secret%'
                lifetime: 604800 # 7 días

    access_control:
        - { path: ^/propietario, roles: ROLE_OWNER }
        - { path: ^/mapa,        roles: ROLE_USER }
        - { path: ^/reservas,    roles: ROLE_USER }
        - { path: ^/mi-area,     roles: ROLE_USER }

    role_hierarchy:
        ROLE_OWNER: ROLE_USER

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