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

    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    # https://symfony.com/doc/current/security/user_providers.html#using-a-custom-query-to-load-the-user
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\User
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            # lazy is necessary to make unauthenticated endpoints
            # (such as user create) work without JWT token
            lazy: true
            provider: app_user_provider
            json_login:
                check_path: /authentication_token
                username_path: username
                password_path: password
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            jwt: ~
            custom_authenticators:
                - App\Security\OAuth\GoogleAuthenticator
                - App\Security\OAuth\HitobitoAuthenticator

    access_control:
        - { path: ^/, roles: PUBLIC_ACCESS } # Some endpoints are available to unauthenticated clients

when@prod:
    security:
        access_control:
            - { path: ^/, roles: PUBLIC_ACCESS, requires_channel: https } # force https, https://symfony.com/doc/current/security/force_https.html

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

    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    # https://symfony.com/doc/current/security/user_providers.html#using-a-custom-query-to-load-the-user
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\User
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            # lazy is necessary to make unauthenticated endpoints
            # (such as user create) work without JWT token
            lazy: true
            provider: app_user_provider
            json_login:
                check_path: /authentication_token
                username_path: username
                password_path: password
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            jwt: ~
            custom_authenticators:
                - App\Security\OAuth\GoogleAuthenticator
                - App\Security\OAuth\HitobitoAuthenticator

    access_control:
        - { path: ^/docs, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI
        - { path: ^/authentication_token, roles: PUBLIC_ACCESS }
        - { path: ^/, roles: PUBLIC_ACCESS } # Some endpoints are available to unauthenticated clients

Revert "Force https in prod env"
Revert "Force https in prod env"

This reverts commit 7b9f664586fae9371fea1505c13fb30d88d59a74.
