security:
  # https://symfony.com/doc/current/security.html#c-hashing-passwords
  password_hashers:
    App\Entity\User: 'auto'

  # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
  providers:
    # used to reload user from session & other features (e.g. switch_user)
    users:
      entity:
        class: App\Entity\User
        property: email
      # mongodb:
      #    class: App\Document\User
      #    property: email

  firewalls:
    dev:
      pattern: ^/_(profiler|wdt)
      security: false
    main:
      stateless: true
      provider: users
      json_login:
        check_path: auth # The name in routes.yaml is enough for mapping
        username_path: email
        password_path: password
        success_handler: lexik_jwt_authentication.handler.authentication_success
        failure_handler: lexik_jwt_authentication.handler.authentication_failure
      jwt: ~

  access_control:
    - { path: ^/$, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI
    - { path: ^/docs, roles: PUBLIC_ACCESS } # Allows accessing API documentations and Swagger UI docs
    - { path: ^/contexts, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI contexts
    - { path: ^/auth, roles: PUBLIC_ACCESS }