services:
  _defaults:
    public: true

  prestashop.adapter.security.command_handler.delete_customer_session_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\DeleteCustomerSessionHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.customer_session_repository'

  prestashop.adapter.security.command_handler.clear_customer_session_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\ClearOutdatedCustomerSessionHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.customer_session_repository'

  prestashop.adapter.security.command_handler.delete_employee_session_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\DeleteEmployeeSessionHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.employee_session_repository'

  prestashop.adapter.security.command_handler.clear_employee_session_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\ClearOutdatedEmployeeSessionHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.employee_session_repository'

  prestashop.adapter.security.command_handler.bulk_delete_employees_sessions_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\BulkDeleteEmployeeSessionsHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.employee_session_repository'

  prestashop.adapter.security.command_handler.bulk_delete_customers_sessions_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Security\CommandHandler\BulkDeleteCustomerSessionsHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.security.repository.customer_session_repository'

  prestashop.adapter.security.repository.customer_session_repository:
    class: 'PrestaShop\PrestaShop\Adapter\Session\Repository\CustomerSessionRepository'
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'
      - '@=service("prestashop.adapter.legacy.configuration").get("PS_COOKIE_LIFETIME_FO")'

  prestashop.adapter.security.repository.employee_session_repository:
    class: 'PrestaShop\PrestaShop\Adapter\Session\Repository\EmployeeSessionRepository'
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'
      - '@=service("prestashop.adapter.legacy.configuration").get("PS_COOKIE_LIFETIME_BO")'

  PrestaShop\PrestaShop\Adapter\Security\Access:
    public: false
