Skip to main content

TaskSetupMFA

Function TaskSetupMFA 

Source
pub fn TaskSetupMFA(_: TaskSetupMFAProps) -> Element
Expand description

Mounted Clerk task setup-MFA UI, for the clerk-js v6 after-auth setup-mfa session task.

Render this when the current session has a pending setup-mfa current_task; clerk-js drives the MFA enrollment flow and navigates to redirect_url_complete once every pending task resolves.

§Example

use dioxus::prelude::*;
use dioxus_clerk::*;

#[component]
fn MfaSetupPage() -> Element {
    rsx! {
        TaskSetupMFA {
            redirect_url_complete: "/",
            class: "mx-auto max-w-md",
        }
    }
}

§Props

For details, see the props struct definition.

  • redirect_url_complete : Option<String>

    Full URL or path Clerk navigates to after all pending session tasks resolve. clerk-js requires this to complete the flow.

  • appearance : Option<serde_json::Value>

    Raw Clerk appearance object.

  • options : TaskSetupMFAOptions

    Advanced options forwarded to Clerk, as a TaskSetupMFAOptions builder or a raw serde_json::Value. Explicit props win when both set the same Clerk option key.

  • id : Option<String>

    Optional id for the Clerk widget host <div> that clerk-js mounts into. May also be set through the attribute spread; this prop wins when both are present.

  • attributes : Vec<Attribute>

    Attributes (including class) spread onto the Clerk widget host <div>.

  • fallback : Element

    Rendered while the Clerk task setup-MFA widget is mounting.