security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    encoders:
        # use your user class name here
        Nordmind\Security\Application\User\Account:
            # bcrypt or argon2i are recommended
            # argon2i is more secure, but requires PHP 7.2 or the Sodium extension
            algorithm: bcrypt
            cost: 12
    providers:
        user_provider:
            id: Nordmind\Security\Application\Security\UserProvider
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js|doc)/
            security: false
        configuration:
            pattern:  ^/api/configuration$
            stateless: true
            anonymous: true
            context: api
        login:
            pattern:  ^/api/security/login$
            stateless: true
            anonymous: true
            context: api
        register:
            pattern: ^/api/security/register$
            anonymous: true
            context: api
        register_confirm:
            pattern: ^/api/security/register/confirm$
            anonymous: true
            context: api
        password_reset_start:
            pattern: ^/api/profile/remind-password/start$
            stateless: true
            anonymous: true
            context: api
        password_reset_reset:
            pattern: ^/api/profile/remind-password/reset$
            stateless: true
            anonymous: true
            context: api
        profile_check_token:
            pattern: ^/api/profile/check-token
            stateless: true
            anonymous: true
            context: api
        api:
            pattern: ^/api
            context: api
            logout:
                path: /api/security/logout
                delete_cookies: ['PHPSESSID', 'BEARER']
            stateless: true
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator

            # activate different ways to authenticate

            # http_basic: true
            # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

            # form_login: true
            # https://symfony.com/doc/current/security/form_login_setup.html

    # Easy way to control access for large sections of your site
    # Note: Only the *first* access control that matches will be used
    access_control:
        - { path: ^/api/security/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/security/register$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/security/register/confirm$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/profile/remind-password/start$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/profile/remind-password/reset$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
