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

# Login

> Process for authenticating a user and granting access to the Creditor Portal.

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["User Enters Email and Password"]
    A --> B["System Validates Credentials"]
    B --> C["System Evaluates Account Status"]
    C --> D["User is Routed to the Appropriate Destination"]

    classDef process fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;

    class A,B,C process;
    class D outcome;
```

## Purpose

Allows an existing user to access the Creditor Portal.

## How It Works

User enters:

* Email
* Password
  System authenticates credentials.

## Result

* User is logged in
* User is routed based on account status

## Validation Rules

* Email must exist
* Password must match
* Email must be verified

## Failure Scenarios

* Invalid credentials
* Unverified email
* Inactive account

## Developer Notes

* Use secure authentication (session or token based)
* Normalize error responses
* Implement rate limiting and brute-force protection
* Return user state flags
* Routing logic should be determined by backend state
