@Override
    protected Event doExecuteInternal(final RequestContext requestContext) throws Throwable {
        val authn = WebUtils.getAuthentication(requestContext);
        val registeredService = WebUtils.getRegisteredService(requestContext);
        val service = WebUtils.getService(requestContext);
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);

        val trustedDevicesDisabled = MultifactorAuthenticationTrustUtils.isMultifactorAuthenticationTrustedDevicesDisabled(requestContext);
        val publicWorkstation = WebUtils.isAuthenticatingAtPublicWorkstation(requestContext);

        if (trustedDevicesDisabled || publicWorkstation || !storage.isAvailable()
            || bypassEvaluator.shouldBypassTrustedDevice(registeredService, service, authn)) {
            LOGGER.debug("Trusted device registration store is unavailable or is disabled for [{}]", registeredService);
            return result(CasWebflowConstants.TRANSITION_ID_SKIP);
        }
        if (trustedProperties.getCore().isAutoAssignDeviceName()) {
            MultifactorAuthenticationTrustUtils.getMultifactorAuthenticationTrustRecord(requestContext, MultifactorAuthenticationTrustBean.class)
                .ifPresent(device -> {
                    val deviceName = namingStrategy.determineDeviceName(registeredService, service, request, authn);
                    LOGGER.debug("Auto-generated device name is [{}]", deviceName);
                    device.setDeviceName(deviceName);
                });
            return result(CasWebflowConstants.TRANSITION_ID_STORE);
        }

        return result(CasWebflowConstants.TRANSITION_ID_REGISTER);
    }
This is {@link MultifactorAuthenticationPrepareTrustDeviceViewAction}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-trusted-mfa-core/src/main/java/org/apereo/cas/trusted/web/flow/MultifactorAuthenticationPrepareTrustDeviceViewAction.java