services:
    gesdinet.jwtrefreshtoken.send_token:
        class: Gesdinet\JWTRefreshTokenBundle\EventListener\AttachRefreshTokenOnSuccessListener
        arguments: [ "@gesdinet.jwtrefreshtoken.refresh_token_manager", "%gesdinet_jwt_refresh_token.ttl%", "@validator", "@request_stack", "%gesdinet_jwt_refresh_token.user_identity_field%", "%gesdinet_jwt_refresh_token.token_parameter_name%", "%gesdinet_jwt_refresh_token.single_use%" ]
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: attachRefreshToken }

    gesdinet.jwtrefreshtoken.refresh_token_manager:
        class: Gesdinet\JWTRefreshTokenBundle\Doctrine\RefreshTokenManager
        public: true
        arguments: [ "@gesdinet.jwtrefreshtoken.object_manager", "%gesdinet.jwtrefreshtoken.refresh_token.class%" ]

    Gesdinet\JWTRefreshTokenBundle\Model\RefreshTokenManagerInterface: '@gesdinet.jwtrefreshtoken.refresh_token_manager'

    gesdinet.jwtrefreshtoken:
        class: Gesdinet\JWTRefreshTokenBundle\Service\RefreshToken
        public: true
        arguments: [ "@gesdinet.jwtrefreshtoken.authenticator", "@gesdinet.jwtrefreshtoken.user_provider", "@lexik_jwt_authentication.handler.authentication_success", "@lexik_jwt_authentication.handler.authentication_failure", "@gesdinet.jwtrefreshtoken.refresh_token_manager", "%gesdinet_jwt_refresh_token.ttl%", "%gesdinet_jwt_refresh_token.security.firewall%", "%gesdinet_jwt_refresh_token.ttl_update%", "@event_dispatcher" ]

    gesdinet.jwtrefreshtoken.user_provider:
        class: Gesdinet\JWTRefreshTokenBundle\Security\Provider\RefreshTokenProvider
        arguments: [ "@gesdinet.jwtrefreshtoken.refresh_token_manager" ]

    gesdinet.jwtrefreshtoken.authenticator:
        class: Gesdinet\JWTRefreshTokenBundle\Security\Authenticator\RefreshTokenAuthenticator
        arguments: [ "@gesdinet.jwtrefreshtoken.user_checker", "%gesdinet_jwt_refresh_token.token_parameter_name%" ]

    Gesdinet\JWTRefreshTokenBundle\Command\ClearInvalidRefreshTokensCommand:
        arguments: ['@gesdinet.jwtrefreshtoken.refresh_token_manager']
        tags: ['console.command']

    Gesdinet\JWTRefreshTokenBundle\Command\RevokeRefreshTokenCommand:
        arguments: ['@gesdinet.jwtrefreshtoken.refresh_token_manager']
        tags: ['console.command']
