EzAuth.UI.TaskVerifyAccount (EzAuth v0.1.0)

Copy Markdown View Source

Code-entry verification task as a LiveComponent.

Renders the auth-card chrome (title + subtitle), the identity being verified (if given), a code input row the user types or pastes the code into, a "Resend" link, a submit button, and a "Back" link in the footer. Submits the code[] params to the parent's phx-target so the orchestrating LiveView or LiveComponent decides what to do with the code.

Auto-advance, Arrow-key / Backspace navigation, and paste distribution across the boxes come from the CodeInput hook in priv/static/ez_auth.js. Hosts must register it on their LiveSocket.

Pass target (typically @myself from the parent) so submit events land in the parent's handle_event/3. Pass on_back as a Phoenix.LiveView.JS command to enable the "Back" button; omit it to hide the button entirely.

Usage

<.live_component
  module={EzAuth.UI.TaskVerifyAccount}
  id="verify"
  identity="user@example.com"
  target={@myself}
  on_back={JS.navigate("/sign-in")}
/>