Sign in with a passkey or a code

A returning user opens the sign-in page and the browser offers their passkey; a verified passkey goes straight to Home. If they cancel the prompt or have no passkey on this device, they sign in with email and password, then type a 6-digit code sent by SMS, which expires after 5 minutes and can be sent again. Five wrong codes lock sign-in for 15 minutes, and the locked page links to account recovery.

13 screens and steps17 arrows0 warnings

What UJN shows here Point at a note to see its part of the drawing

Sign in with a passkey or a code  MFA_SIGNINThe browser offers a passkey; without one, a password and then a code by SMSStart, deep link Returning user, signed out Route: /signinStart, deep linkReturning user, signed outPasskey prompt (Auth) Offered before the passwordAuthPasskey promptOffered before the passwordSign in (View) Email and password Route: /signinViewSign inEmail and password/signinCheck password (Action)ActionCheck passwordSend SMS code (Message) 6 digits Channel: SMSMessageSend SMS code6 digitsSMSEnter the code (View) Sent to the phone ending 42 Route: /signin/codeViewEnter the codeSent to the phone ending 42/signin/codeCode expires (Wait) Countdown on the code screen Timeout: 5 minWaitCode expiresCountdown on the code screen5 minCode expired (Toast) Send a new oneToastCode expiredSend a new oneCheck code (Action) 5 wrong codes lock sign-inActionCheck code5 wrong codes lock sign-inAccounts (Server database) Location: table accountsServer databaseAccountstable accountsHome (View) Signed in Route: /homeViewHomeSigned in/homeSign-in locked (View) Try again in 15 minutes Route: /signin/lockedViewSign-in lockedTry again in 15 minutes/signin/lockedRecover your account (Journey) Lost phone or no access Journey: ACCOUNT_RECOVERYJourneyRecover your accountLost phone or no accessACCOUNT_RECOVERYNo label Navigation from from_site to Passkey promptverified Navigation from Passkey prompt to Homeverifiedcanceled or no passkey Navigation from Passkey prompt to Sign incanceled or no passkeyUse a passkey Navigation from Sign in to Passkey promptUse a passkeySign in Navigation from Sign in to Check password Payload: {email, password}Sign in{email, password}correct Navigation from Check password to Send SMS codecorrectNo label Navigation from Send SMS code to Enter the codeNo label Navigation from Send SMS code to Code expiresResend code Navigation from Enter the code to Send SMS codeResend codeVerify Navigation from Enter the code to Check code Payload: {code}Verify{code}correct Navigation from Check code to Homecorrectfifth wrong code Negative from Check code to Sign-in lockedfifth wrong codetimeout Negative from Code expires to Code expiredtimeoutNo label Navigation, write from Check code to Accounts Payload: {wrong_codes, locked_until}{wrong_codes, locked_until}Recover your account Navigation from Sign-in locked to Recover your accountRecover your accountwrong password Failed return from Check password to Sign inwrong passwordwrong, tries left Failed return from Check code to Enter the codewrong, tries left
The source (38 lines)
mfa.puml
@startujnrender { direction: down; arrow_spacing: 24 }journey MFA_SIGNIN "Sign in with a passkey or a code"description: "The browser offers a passkey; without one, a password and then a code by SMS"unique_id_friendly: mfa_signin start from_site { type: deep-link; description: "Returning user, signed out"; route: /signin }action passkey { type: auth; title: "Passkey prompt"; description: "Offered before the password" }view password { title: "Sign in"; description: "Email and password"; route: /signin }action check_password { title: "Check password" }action send_code { type: message; title: "Send SMS code"; description: "6 digits"; channel: SMS }view enter_code { title: "Enter the code"; description: "Sent to the phone ending 42"; route: /signin/code }action countdown { type: wait; title: "Code expires"; description: "Countdown on the code screen"; timeout: 5 min }view code_expired { type: toast; title: "Code expired"; description: "Send a new one" }action check_code { title: "Check code"; description: "5 wrong codes lock sign-in" }data accounts { title: "Accounts"; location: "table accounts" }view home { title: "Home"; description: "Signed in"; route: /home }view locked { title: "Sign-in locked"; description: "Try again in 15 minutes"; route: /signin/locked }ref recover { journey: ACCOUNT_RECOVERY; title: "Recover your account"; description: "Lost phone or no access" } from_site --> passkeypasskey --> home : verifiedpasskey --> password : canceled or no passkeypassword -up-> passkey : [Use a passkey]password --> check_password : [Sign in] { payload: [email, password] }check_password --> send_code : correctcheck_password .x.> password : wrong passwordsend_code --> enter_codesend_code --> countdowncountdown -left-x-> code_expired : timeoutenter_code -up-> send_code : [Resend code]enter_code --> check_code : [Verify] { payload: [code] }check_code -left-> accounts { payload: [wrong_codes, locked_until] }check_code --> home : correctcheck_code .x.> enter_code : wrong, tries leftcheck_code -x-> locked : fifth wrong codelocked -right-> recover : [Recover your account]@endujn