---
title: "useLoginFlow"
description: "useLoginFlow, auto-imported in the app: its options, return value and types."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/use-login-flow"
---
# useLoginFlow

Version: nuxt-backend 0.6.x · Tab: Reference · Kind: reference · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

## Interfaces

### UseLoginFlowOptions

Defined in: [src/runtime/vue/composables/use-login-flow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="validateemail">
        
      </a>
      
       <code>
        validateEmail?
      </code>
    </td>
    
    <td>
      (<code>
        email
      </code>
      
      ) => <code>
        string
      </code>
      
       | <code>
        boolean
      </code>
    </td>
    
    <td>
      Gate the email before sending. Return <code>
        true
      </code>
      
       to accept, <code>
        false
      </code>
      
       for the default message, or a string for a custom one. Default: a basic shape check.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onsuccess">
        
      </a>
      
       <code>
        onSuccess?
      </code>
    </td>
    
    <td>
      () => <code>
        unknown
      </code>
    </td>
    
    <td>
      Called once the user is signed in and the flow is complete (e.g. <code>
        navigateTo
      </code>
      
      ): once per flow, however the last step is reached. If it rejects, the failure is in <code>
        error
      </code>
      
      , and the next action that completes the flow (Skip, Add, a passkey sign-in) calls it again.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="autofill">
        
      </a>
      
       <code>
        autofill?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Offer this browser's saved passkeys in the autofill of the email field (WebAuthn conditional mediation), so a person who has one signs in by picking it there, without a code. The field's <code>
        autocomplete
      </code>
      
       must end in <code>
        webauthn
      </code>
      
      : <code>
        autocomplete="username webauthn"
      </code>
      
      . The flow asks once it is mounted, on a step before a code was sent (<code>
        choose
      </code>
      
      , <code>
        request-code
      </code>
      
      ) whose markup has such a field, and never while signed in. One offer waits at a time, renewed every four and a half minutes while the page is in view (a challenge lasts five), and once the page comes back into view after that. It asks again when a step brings the field back after the offer ended (a passkey prompt opened in its place, a passkey refused), and when a passkey picked there met an expired challenge. A passkey picked there finishes the flow as <code>
        signInWithPasskey
      </code>
      
       does; one the server refuses lands in <code>
        error
      </code>
      
      . An offer that ends before anyone picks a passkey says nothing. Default <code>
        false
      </code>
      
      : <code>
        <AuthForm>
      </code>
      
       turns it on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="preferlastmethod">
        
      </a>
      
       <code>
        preferLastMethod?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Open on the step of the way this browser last signed in (<code>
        lastMethod
      </code>
      
      ): the email step after a code (<code>
        request-code
      </code>
      
      ), the first step otherwise, where the passkey button is. <code>
        reset()
      </code>
      
       returns there too. The server render reads the same cookie, so both open on the same step; a page prerendered or served from a cache moves to this browser's own once hydrated, while it is still on the step it opened on. Default <code>
        false
      </code>
      
      : <code>
        <AuthForm>
      </code>
      
       turns it on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UseLoginFlowReturn

Defined in: [src/runtime/vue/composables/use-login-flow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="step">
        
      </a>
      
       <code>
        step
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<a href="#loginstep">
        <code>
          LoginStep
        </code>
      </a>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="lastmethod">
        
      </a>
      
       <code>
        lastMethod
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#signinmethod">
        <code>
          SignInMethod
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      How this browser last signed in — <code>
        'passkey'
      </code>
      
       or <code>
        'email-otp'
      </code>
      
       — or <code>
        null
      </code>
      
      : the one place to read it, for a "Last used" mark on that method's button.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="webauthnsupported">
        
      </a>
      
       <code>
        webAuthnSupported
      </code>
    </td>
    
    <td>
      <code>
        Readonly
      </code>
      
      <<code>
        Ref
      </code>
      
      <<code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      Whether this browser can run a passkey ceremony at all (WebAuthn): <code>
        null
      </code>
      
       until the flow's component has mounted, so the server render and the first client render agree, then <code>
        true
      </code>
      
       or <code>
        false
      </code>
      
      . An in-app browser or a plain-http origin has none, and a passkey offered there only ends in an error: hide the passkey button where it reads <code>
        false
      </code>
      
       (<code>
        v-if="webAuthnSupported !== false"
      </code>
      
      ), as <code>
        <AuthForm>
      </code>
      
       does.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="otp">
        
      </a>
      
       <code>
        otp
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="recoverycode">
        
      </a>
      
       <code>
        recoveryCode
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      The recovery code a passkey-only account types on <code>
        recover
      </code>
      
      . Once <code>
        recover()
      </code>
      
       signed in, it holds the new code that replaced the used one, to show once.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="invitecode">
        
      </a>
      
       <code>
        inviteCode
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      The invite code a new address types on <code>
        invite-code
      </code>
      
       (or on <code>
        waitlisted
      </code>
      
      , when it has one), while the app is closed.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="age">
        
      </a>
      
       <code>
        age
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      The age a new address types on <code>
        age
      </code>
      
      , when the app sets a minimum age. The question has an empty field and never names the minimum; the number is checked on the server and never kept.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="waitlist">
        
      </a>
      
       <code>
        waitlist
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      < | { <code>
        position?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        total?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        token
      </code>
      
      : <code>
        string
      </code>
      
      ; } | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Where the address stands on the waitlist, once its code checked while the app is in early access (the <code>
        waitlisted
      </code>
      
       step shows it); <code>
        null
      </code>
      
       otherwise. <code>
        position
      </code>
      
       and <code>
        total
      </code>
      
       only where the waitlist shows rank (<code>
        setupAccess({ waitlist: { place: { rank: false } } })
      </code>
      
       leaves the token alone).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="twofactorcode">
        
      </a>
      
       <code>
        twoFactorCode
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        string
      </code>
      
      >
    </td>
    
    <td>
      The code from the authenticator app (or, with <code>
        withBackupCode
      </code>
      
      , a backup code) an account with one types on <code>
        two-factor
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="withbackupcode">
        
      </a>
      
       <code>
        withBackupCode
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      Whether <code>
        two-factor
      </code>
      
       takes a backup code instead of the app's code. Switching clears the field and <code>
        error
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="trustdevice">
        
      </a>
      
       <code>
        trustDevice
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      Whether this browser skips the <code>
        two-factor
      </code>
      
       step for thirty days once the code checks.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="passkeyrequired">
        
      </a>
      
       <code>
        passkeyRequired
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      <code>
        true
      </code>
      
       on <code>
        passkey-offer
      </code>
      
       after a recovery: a passkey must be saved, and <code>
        skipPasskey()
      </code>
      
       does nothing.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="ispending">
        
      </a>
      
       <code>
        isPending
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      <code>
        true
      </code>
      
       while a step's call runs.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="error">
        
      </a>
      
       <code>
        error
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      < | <a href="https://nuxt-backend.dev/docs/reference/api/functions#backenderror">
        <code>
          BackendError
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Why the last step failed, or <code>
        null
      </code>
      
      : <code>
        invalid_input
      </code>
      
       on <code>
        email
      </code>
      
       for an address <code>
        validateEmail
      </code>
      
       refused, <code>
        rate_limited
      </code>
      
      , <code>
        forbidden
      </code>
      
       with reason <code>
        banned
      </code>
      
       for a banned account, … Set it to <code>
        null
      </code>
      
       to clear it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="retryafter">
        
      </a>
      
       <code>
        retryAfter
      </code>
    </td>
    
    <td>
      <code>
        Ref
      </code>
      
      <<code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Seconds until a rate-limited step can be retried, for a countdown next to <code>
        error
      </code>
      
      ; <code>
        null
      </code>
      
       when the last failure was not a rate limit or gave no wait.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="emailvalid">
        
      </a>
      
       <code>
        emailValid
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      Whether the current email passes <code>
        validateEmail
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="signinwithpasskey">
        
      </a>
      
       <code>
        signInWithPasskey
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Sign in with a passkey already saved on this device, through the browser's passkey prompt.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="sendcode">
        
      </a>
      
       <code>
        sendCode
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Email an OTP code to <code>
        email
      </code>
      
       → <code>
        verify-code
      </code>
      
      , or <code>
        undeliverable
      </code>
      
       when the email provider stopped delivering to the address.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="verifycode">
        
      </a>
      
       <code>
        verifyCode
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Verify the entered code (signs in / signs up) → <code>
        passkey-offer
      </code>
      
      , or done at once where this browser can save no passkey.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="verifytwofactor">
        
      </a>
      
       <code>
        verifyTwoFactor
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Check <code>
        twoFactorCode
      </code>
      
       on <code>
        two-factor
      </code>
      
      , the step a sign-in code moves an account with an authenticator app to → <code>
        passkey-offer
      </code>
      
      , as <code>
        verifyCode
      </code>
      
      . A wrong code stays, refused as <code>
        invalid_input
      </code>
      
       on <code>
        twoFactorCode
      </code>
      
      ; once the ten minutes after the sign-in code passed (reason <code>
        two_factor_expired
      </code>
      
      ), <code>
        goTo('request-code')
      </code>
      
       starts again.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="redeeminvitecode">
        
      </a>
      
       <code>
        redeemInviteCode
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Check <code>
        inviteCode
      </code>
      
       and sign up with it and the code already typed → <code>
        passkey-offer
      </code>
      
      . A code that admits nobody stays on <code>
        invite-code
      </code>
      
      , refused as <code>
        invalid_input
      </code>
      
       on <code>
        inviteCode
      </code>
      
       (reason <code>
        invite_expired
      </code>
      
      , <code>
        invite_used_up
      </code>
      
       or <code>
        invite_revoked
      </code>
      
      , none for an unknown code).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="submitage">
        
      </a>
      
       <code>
        submitAge
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Send the same code again with the age typed → <code>
        passkey-offer
      </code>
      
      . An age that is no number stays on <code>
        age
      </code>
      
      , refused as <code>
        invalid_input
      </code>
      
       on <code>
        age
      </code>
      
      ; one under the minimum is refused as <code>
        forbidden
      </code>
      
       (reason <code>
        under_age
      </code>
      
      ) and this browser is refused for a day.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="addpasskey">
        
      </a>
      
       <code>
        addPasskey
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Save a passkey on the current account (the offer after a code, or the one a recovery requires) → done.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="skippasskey">
        
      </a>
      
       <code>
        skipPasskey
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Decline the passkey offer → done. Does nothing while <code>
        passkeyRequired
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="recover">
        
      </a>
      
       <code>
        recover
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Check <code>
        email
      </code>
      
       and <code>
        recoveryCode
      </code>
      
       for a passkey-only account → <code>
        passkey-offer
      </code>
      
       with <code>
        passkeyRequired
      </code>
      
      : the new passkey is saved before anything else.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="goto">
        
      </a>
      
       <code>
        goTo
      </code>
    </td>
    
    <td>
      (<code>
        step
      </code>
      
      ) => <code>
        void
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bind">
        
      </a>
      
       <code>
        bind
      </code>
    </td>
    
    <td>
      <a href="#loginbindings">
        <code>
          LoginBindings
        </code>
      </a>
    </td>
    
    <td>
      Attribute and handler bags for markup of your own, one per element: <code>
        emailInput
      </code>
      
      , <code>
        codeInput
      </code>
      
      , <code>
        submit
      </code>
      
      , <code>
        passkeyButton
      </code>
      
      , <code>
        back
      </code>
      
       and <code>
        status
      </code>
      
      . Spread each with <code>
        v-bind
      </code>
      
      ; they carry the accessibility attributes the packaged form has.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="reset">
        
      </a>
      
       <code>
        reset
      </code>
    </td>
    
    <td>
      () => <code>
        void
      </code>
    </td>
    
    <td>
      Back to the opening step (<code>
        choose
      </code>
      
      , or the one <code>
        preferLastMethod
      </code>
      
       picks) with every field cleared.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts" rel="nofollow">
        src/runtime/vue/composables/use-login-flow.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### LoginBindings

Defined in: [src/runtime/vue/utils/login-bindings.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts)

The attribute and handler bags `useLoginFlow().bind` holds, one per element of a sign-in form.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Modifier
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="emailinput">
        
      </a>
      
       <code>
        emailInput
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      The email <code>
        <input>
      </code>
      
      : its type, <code>
        autocomplete="username webauthn"
      </code>
      
       for passkey autofill, and the refusal when it names the address.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="codeinput">
        
      </a>
      
       <code>
        codeInput
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      The code <code>
        <input>
      </code>
      
      : numeric, <code>
        autocomplete="one-time-code"
      </code>
      
      , the refusal's description, and focus when the person opened its step.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="submit">
        
      </a>
      
       <code>
        submit
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      The step's submit button: <code>
        type="submit"
      </code>
      
      , and <code>
        aria-disabled
      </code>
      
       while a step runs, so it keeps focus.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="passkeybutton">
        
      </a>
      
       <code>
        passkeyButton
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      The passkey button: its click handler, and <code>
        aria-disabled
      </code>
      
       while the browser's prompt is open.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="back">
        
      </a>
      
       <code>
        back
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      The button back to the previous step, which puts focus on the field it returns to.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      An empty element: a polite status that says a code was sent, and an alert that says why a step failed.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/login-bindings.ts" rel="nofollow">
        src/runtime/vue/utils/login-bindings.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Type Aliases

### LoginStep

```ts
type LoginStep = 
  | "choose"
  | "request-code"
  | "verify-code"
  | "passkey-offer"
  | "recover"
  | "waitlisted"
  | "invite-code"
  | "age"
  | "undeliverable"
  | "two-factor";
```

Defined in: [src/runtime/vue/composables/use-login-flow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts)

---

### SignInMethod

```ts
type SignInMethod = "passkey" | "email-otp";
```

Defined in: [src/runtime/vue/utils/auth-session.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/utils/auth-session.ts)

How a person signs in: with a passkey, or with a code from their inbox.

## Functions

### useLoginFlow()

```ts
function useLoginFlow(options?): UseLoginFlowReturn;
```

Defined in: [src/runtime/vue/composables/use-login-flow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-login-flow.ts)

The headless login flow behind `<AuthForm>` — bring your own markup and wire
these refs/actions to it. Encodes the proven passwordless sequencing:
session-refetch after sign-in, then an optional post-OTP passkey enrolment.

A step machine: its actions never reject. A failed step stays where it
is, with the reason in `error` (a `BackendError`) and the wait of a rate
limit in `retryAfter`, so a form never needs a `try`.

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <a href="#useloginflowoptions">
        <code>
          UseLoginFlowOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

[`UseLoginFlowReturn`](#useloginflowreturn)


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
