@Override
    public Optional<PasswordlessAuthenticationToken> findToken(final String username) {
        val query = new Query().addCriteria(Criteria.where("username").is(hashUsername(username)));
        val authnToken = mongoTemplate.findOne(query, MongoDbPasswordlessAuthenticationEntity.class, properties.getCollection());
        return Optional.ofNullable(authnToken).map(token -> decodePasswordlessAuthenticationToken(token.getRecord()));
    }
This is {@link MongoDbPasswordlessTokenRepository}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-passwordless-mongo/src/main/java/org/apereo/cas/impl/token/MongoDbPasswordlessTokenRepository.java