MishkaCmsCoreWeb.Live.Admin.Components.TwoFactor (Mishka CMS Core v0.0.1)

Copy Markdown View Source

The signed-in account's authenticator app, a security card on the settings page's Preferences tab (SecurityCards): set up, or turned off. See MishkaCmsCore.Accounts.SecondFactor for what it changes at sign-in. Turning it on or off tells the other cards (:account_security_changed), so the recovery codes card follows.

Setting one up is the totp strategy's two steps. setup_with_totp stores nothing and hands back the otpauth:// address and a setup token, kept in this component while the QR code and the secret are shown; confirm_setup_with_totp stores the secret once a code from the app matches. Turning it off asks a current code (disable_totp).

<.live_component module={TwoFactor} id="two-factor" current_user={@current_user} />