class RedisTokenAuthenticationManager implements TokenAuthenticationManager {

    private final ReactiveRedisOperations<String, Authentication> operations;

    @SuppressWarnings("all")
    public RedisTokenAuthenticationManager(ReactiveRedisConnectionFactory connectionFactory) {
        this(new ReactiveRedisTemplate<>(
                connectionFactory, RedisSerializationContext.<String, Authentication>newSerializationContext()
                .key(RedisSerializer.string())
                .value((RedisSerializer) RedisSerializer.java())
                .hashKey(RedisSerializer.string())
                .hashValue(RedisSerializer.java())
                .build()
        ));
    }

    public RedisTokenAuthenticationManager(ReactiveRedisOperations<String, Authentication> operations) {
        this.operations = operations;
    }

    @Override
    public Mono<Authentication> getByToken(String token) {
        return operations
                .opsForValue()
                .get("token-auth:" + token);
    }

    @Override
    public Mono<Void> removeToken(String token) {
        return operations
                .delete(token)
                .then();
    }

    @Override
    public Mono<Void> putAuthentication(String token, Authentication auth, Duration ttl) {<FILL_FUNCTION_BODY>}
}

        return ttl.isNegative()
                ? operations
                .opsForValue()
                .set("token-auth:" + token, auth)
                .then()
                : operations
                .opsForValue()
                .set("token-auth:" + token, auth, ttl)
                .then()
                ;
    
<no_super_class>