protected Event createAndSendPasswordlessToken(final RequestContext requestContext, final PasswordlessUserAccount user,
                                                   final PasswordlessAuthenticationRequest passwordlessRequest) {
        val token = passwordlessTokenRepository.createToken(user, passwordlessRequest);
        communicationsManager.validate();

        val emailSent = emailToken(requestContext, user, token);
        val smsSent = smsToken(requestContext, user, token);
        if (emailSent || smsSent) {
            LOGGER.info("Storing passwordless token for [{}]", user.getUsername());
            passwordlessTokenRepository.deleteTokens(user.getUsername());
            passwordlessTokenRepository.saveToken(user, passwordlessRequest, token);
            return success(token);
        }
        LOGGER.error("Failed to send passwordless token to [{}]", user.getUsername());
        return error();
    }
This is {@link CreatePasswordlessAuthenticationTokenAction}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-passwordless-webflow/src/main/java/org/apereo/cas/web/flow/CreatePasswordlessAuthenticationTokenAction.java