@Override
    protected Event doExecuteInternal(final RequestContext requestContext) throws Throwable {
        try {
            val token = requestContext.getRequestParameters().getRequired("token");
            val tokenCredential = new CasSimpleMultifactorTokenCredential(token);
            val ticket = multifactorAuthenticationService.getMultifactorAuthenticationTicket(tokenCredential);
            val credentialPrincipal = multifactorAuthenticationService.getPrincipalFromTicket(ticket);
            val resolvedPrincipal = resolvePrincipal(credentialPrincipal, requestContext);
            val emailAddress = ticket.getProperty(CasSimpleMultifactorVerifyEmailAction.TOKEN_PROPERTY_EMAIL_TO_REGISTER, String.class);
            val principal = multifactorAuthenticationService.validate(resolvedPrincipal, tokenCredential);
            LOGGER.debug("Updating email address [{}] for [{}]", emailAddress, principal.getId());
            multifactorAuthenticationService.update(principal,
                Map.of(CasSimpleMultifactorVerifyEmailAction.TOKEN_PROPERTY_EMAIL_TO_REGISTER, emailAddress));
            MultifactorAuthenticationWebflowUtils.removeSimpleMultifactorAuthenticationToken(requestContext);
            return eventFactory.event(this, CasWebflowConstants.TRANSITION_ID_RESUME,
                new LocalAttributeMap<>(Map.of(CasSimpleMultifactorVerifyEmailAction.TOKEN_PROPERTY_EMAIL_TO_REGISTER, emailAddress)));
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        WebUtils.addErrorMessageToContext(requestContext, ERROR_CODE_TOKEN_FAILED);
        return error();
    }
This is {@link CasSimpleMultifactorUpdateEmailAction}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-simple-mfa-core/src/main/java/org/apereo/cas/mfa/simple/web/flow/CasSimpleMultifactorUpdateEmailAction.java