> ## 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.

# Email Verification

> Confirm a creditor user's email address before account access is treated as verified.

## Real-World Example

A user from ABC Collections registers with `user@example.com`. The system sends the verification email to that address. The user opens the email and clicks the verification link.

After that click, the portal should treat the user account as verified. If the user still has setup steps left, they should continue to the Set Up Wizard. If setup is already complete, they should continue to the dashboard.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Creditor user registers"] --> B["Verification email is sent"]
    B --> C["User opens email"]
    C --> D["User clicks verification link"]
    D --> E["Email is marked verified"]
    E --> F["User continues into the creditor portal"]
    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 actor;
    class B,E,F outcome;
    class C,D system;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* A verification email should be sent after registration.
* The verification link should confirm the correct user account.
* Verified users should continue into the creditor portal based on their setup status.
* Users who still need verification should be shown the email verification notice.

## How It Should Not Work

* It should not verify the wrong user.
* It should not treat an unverified user as fully verified.
* It should not expose verification links that can be reused for unrelated users.
* It should not block a verified user as if verification is still pending.

## Developer Notes

* Protect login, registration, verification, and password reset redirects from sending users to the wrong portal state.
* Any new auth path should preserve creditor company ownership and email verification behavior.

## Related App Areas

* `routes/creditor/auth.php`
* `app/Livewire/Creditor/Auth`
