@Override
    public PasswordlessAuthenticationToken saveToken(final PasswordlessUserAccount passwordlessAccount,
                                                     final PasswordlessAuthenticationRequest passwordlessRequest,
                                                     final PasswordlessAuthenticationToken authnToken) {
        return FunctionUtils.doUnchecked(() -> {
            val entity = MongoDbPasswordlessAuthenticationEntity.builder()
                .expirationDate(authnToken.getExpirationDate())
                .username(hashUsername(authnToken.getUsername()))
                .record(encodeToken(authnToken))
                .build();
            val result = mongoTemplate.save(entity, properties.getCollection());
            return authnToken.withId(result.getId());
        });
    }
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