> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OTP Verification

> Jane signs in from a new link and the portal sends a one-time code.

## Real-World Example

Jane signs in from a new link and the portal sends a one-time code. She enters the code, the portal confirms it belongs to her current profile, and only then shows her account offers.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Portal sends a one-time code"] --> B["Consumer enters the code"]
    B --> C{"Code matches current consumer?"}
    C -->|Yes| D["Verification is accepted"]
    C -->|No| E["Portal rejects the attempt"]
    D --> F["Consumer can continue to protected pages"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A,B,D system;
    class C decision;
    class E risk;
    class F outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should validate the OTP against the current consumer and requested verification type.
* It should allow resend behavior without creating duplicate account access.
* It should move the consumer forward only after successful verification.

## How It Should Not Work

* It should not accept expired, reused, or mismatched codes.
* It should not verify one consumer by using another consumer OTP.
* It should not reveal protected account details after a failed code attempt.

## Developer Notes

* OTP verification protects login and contact-change workflows.
* Keep failure messaging helpful but avoid exposing which account details exist.

## Related App Areas

* `routes/consumer/index.php`
* `app/Livewire/Consumer/VerifyOTP.php`
* `app/Livewire/Consumer/Forms/VerifyOTPForm.php`
* `app/Livewire/Consumer/Forms/ConsumerVerificationForm.php`
