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


        login:
            pattern: ^/api/login
            stateless: true
            json_login:
                check_path: /api/login
                username_path: email
                password_path: password
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure


        api:
            pattern: ^/api
            stateless: true
            jwt: ~


        main:
            lazy: true
            provider: app_user_provider
            logout: true


    access_control:
        -   path: ^/api/login
            roles: PUBLIC_ACCESS
        -   path: ^/api/register
            roles: PUBLIC_ACCESS
        -   path: ^/api/products
            roles: PUBLIC_ACCESS
        -   path: ^/api/menu
            roles: PUBLIC_ACCESS
        -   path: ^/api/orders
            roles: IS_AUTHENTICATED_FULLY
        -   path: ^/api
            roles: IS_AUTHENTICATED_FULLY

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