๐
Sub-flow: Authenticate via Email Verification Code
SUC-IDP-01
This page is a sub-flow invoked from another use case โ when finished, control returns to the caller.
Verification Code
Enter the 6-digit code sent to your contact
Invalid verification code โ please try again.
Verification code has expired โ a new code has been sent.
Unable to send the verification code via email at the moment. Please try another channel.
Email verification code channel temporarily locked
You entered the wrong verification code 5 times โ this channel is locked for 15 minutes.
Time remaining: 15:00
Channel
Email
Sent to
user@example.com
Expires in 5:00
REF:
REF-XXXXX
Screen Flow (per flow.puml):
๐ Spec notes โ SUC-IDP-01 / SCR-IDP.02 (fields, actions, requirements)
Identity
- SUC: SUC-IDP-01 โ Authenticate via email verification code
- Screen: SCR-IDP.02 โ Verification Code
- Invoked by (Learner Portal): UC-IDP.01 (Register as Learner), UC-IDP.09 (Update Learner Profile), UC-IDP.22 (Forgot Password)
ReturnUrl context
- Current:
/forgot-password/ - Fallback:
/when returnUrl is empty - Finish โ returnUrl; Cancel โ cancelUrl (if provided) or returnUrl +
&sub_cancelled=1 - cancelUrl:
(none — fallback to returnUrl?sub_cancelled=1)
Brief description
6-digit email verification code sub-flow. System sends the code before opening this page; user enters it; system verifies. Handles wrong code (inline error + retry), expired code (inline message + auto-resend), resend throttling, and 5-failure inline lockout (AF 3C / SS-IDP.01) โ all without page redirect.
Regions
- Verification Code Delivery Info โ Channel (read-only), Sent to (read-only, always unmasked)
- Verification Code Entry โ Verification Code (required, 6-digit numeric), Expires in (live countdown), REF (read-only)
- Footer Actions โ Verify, Resend Verification Code, Change Method
Fields
delivery_channel"Channel" โ text ยท read-only ยท source: session.otp_channel ยท alwayscontact"Sent to" โ text ยท read-only ยท source: session.contact_full (full unmasked โ AR-7) ยท alwaysotp_code"Verification Code" โ text ยท required ยท always ยท validation: length:6, digits_onlycountdown_remaining"Expires in" โ text ยท read-only ยท computed ยท alwaysref_key"REF" โ text ยท read-only ยท source: session.otp_ref_key ยท always
Actions
verify"Verify" โ enabled whenotp_code.length == 6 && !lockedยท triggers SUC-IDP-01-M-2resend"Resend verification code" โ enabled when not locked ยท triggers SUC-IDP-01-A-3A-2change_method"Change Method" โ always ยท back navigation to calling UC's method-selection screen
Additional requirements
- 5-minute countdown (SS-IDP.02); at 0:00 โ inline expiry message + prompt Resend. [SS-IDP.02]
- Inline error below otp_code on invalid code: "Invalid verification code โ please try again." [โ]
- Auto-focus otp_code on page load; Verify enabled only when 6 digits filled. [NFR-09]
- AF 3C inline lockout: 5 wrong attempts โ disable input + Resend, show lock panel with 15-min countdown; auto-reopen when lock expires. [SS-IDP.01]
- Resend during lock window โ "You cannot request a new verification code at this time โ please wait 15 minutes." [SS-IDP.01]
- "Change Method" navigates back to the method-selection screen of the calling UC; target not hardcoded. [โ]
contactalways displayed full and unmasked โ email: full address; SMS: full number (e.g. +66812345678).session.contact_fullmust carry the unmasked value. [โ]