Doklo

leaf-web

Dok Hub

IA9Roles4Lexicon0Code mapping

Doks

Doks 7·Domains 7

All 7Needs review 2Active 5Stale 3
7 Doks shown

Admin

ADMIN-MODERATIONAdmin review moderation

Sign in

AUTH-SIGNINEmail and password sign-in

Sign up

AUTH-SIGNUPNew account registrationdrift

Reading circles

CIRCLESReading circle membership managementdrift

Reading journal

JOURNALBook reflection journal

Bookshelf

LIBRARYPersonal reading shelf tracker

Notifications

NOTICESClub update notificationsdrift
Read-only demo

Product preview

Dok Hub

You’re browsing a read-only sample workspace — a fictional reading-circle app, read by Doklo and reviewed by a person. Nothing here can be changed. Free to start: 40 credits on your first GitHub connection, and every repository’s first generation free (up to 30 Doks). Get started free · Back to doklo.io

AUTH-SIGNINactivecritical

Email and password sign-in

Visitors sign in with an email and password on the /login page; a successful attempt creates a server-side session and sets a 7-day httpOnly cookie, while invalid credentials or malformed input are rejected with specific error codes.

Document details · v1
5 steps · 4 rules · 5 criteriaweb#authentication #login #session #credentials #cookie
approved 2026-10-03
User flow 3Business rules 4Acceptance criteria 5

User flow

3
  1. 01

    user

    View the sign-in form to access the application

    Result

    The sign-in panel is shown with email and password fields, a sign-in/register toggle, and quick-login buttons for demo accounts (labelled member, host, admin)

    Interaction details
    • all · navigate
  2. 02

    user

    Submit email and password to sign in

    Result

    The credentials are sent to the server for authentication

    Starts when · Email is at most 120 characters and password is at most 128 characters, both provided

    Interaction details
    • all · submit
  3. 03

    user

    Sign in instantly using one of the provided demo accounts

    Result

    The same sign-in flow runs with a preset demo email and password, logging the user in as that demo persona without typing credentials

    Interaction details
    • all · click

Business rules

4

Policies and constraints the product must keep.

  • 01ValidationBR-AUTH-SIGNIN-01

    Email and password must both be provided as strings, with email at most 120 characters and password at most 128 characters; otherwise a VALIDATION error with status 400 is returned.

    Linked criteria 1Criterion 03
    Read linked criteria here
    • AC-AUTH-SIGNIN-03Submitting a missing email/password, a non-string value, or a value exceeding the length limit returns status 400 with error code VALIDATION.
  • 02ValidationBR-AUTH-SIGNIN-02

    Sign-in fails with an INVALID_CREDENTIALS error (status 401) when no user matches the submitted email or the password does not verify against the stored password hash.

    Linked criteria 2Criterion 01Criterion 02
    Read linked criteria here
    • AC-AUTH-SIGNIN-01Submitting a valid email and matching password returns a success result with status 200, sets the session cookie, and the signed-in view replaces the sign-in panel.
    • AC-AUTH-SIGNIN-02Submitting an email with no matching account, or the correct email with a wrong password, returns status 401 with error code INVALID_CREDENTIALS and no cookie is set.
  • 03PolicyBR-AUTH-SIGNIN-03

    On successful sign-in a session token is generated and stored server-side, and any previously stored sessions that have already expired are removed at the same time.

    Linked criteria 1Criterion 01
    Read linked criteria here
    • AC-AUTH-SIGNIN-01Submitting a valid email and matching password returns a success result with status 200, sets the session cookie, and the signed-in view replaces the sign-in panel.
  • 04PolicyBR-AUTH-SIGNIN-04

    The session cookie set after sign-in is httpOnly, uses the lax same-site policy, is marked secure when the request arrives over HTTPS, and expires after 604800 seconds (7 days).

    Linked criteria 1Criterion 01
    Read linked criteria here
    • AC-AUTH-SIGNIN-01Submitting a valid email and matching password returns a success result with status 200, sets the session cookie, and the signed-in view replaces the sign-in panel.

Acceptance criteria

5

Expected outcomes. These entries do not claim a test was run or passed.

  1. 01CriterionAC-AUTH-SIGNIN-01

    Submitting a valid email and matching password returns a success result with status 200, sets the session cookie, and the signed-in view replaces the sign-in panel.

    Linked rules 3Rule 02Rule 03Rule 04
  2. 02CriterionAC-AUTH-SIGNIN-02

    Submitting an email with no matching account, or the correct email with a wrong password, returns status 401 with error code INVALID_CREDENTIALS and no cookie is set.

    Linked rules 1Rule 02
  3. 03CriterionAC-AUTH-SIGNIN-03

    Submitting a missing email/password, a non-string value, or a value exceeding the length limit returns status 400 with error code VALIDATION.

    Linked rules 1Rule 01
  4. 04CriterionAC-AUTH-SIGNIN-04

    Clicking a demo account button signs the user in with that account's fixed email and password without requiring manual entry.

    Linked rules 0
  5. 05CriterionAC-AUTH-SIGNIN-05

    Any unexpected server error during sign-in returns status 500 with error code INTERNAL instead of leaking internal details.

    Linked rules 0
Source files 19
  • page.tsx
  • LeafProvider.tsx
  • useLeafState.ts
  • useLeafLocale.ts
  • locale.ts
  • layout.tsx
  • headings.tsx
  • store.mjs
  • initial-state.mjs
  • password.mjs
  • action-support.ts
  • domain-error.mjs
  • session.mjs
  • validation.mjs
  • types.ts
  • auth.tsx
  • actions.ts
  • auth.mjs
  • actionView.ts

Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.

Hub context & agents

Hub trust

Doks
7
Source anchors
133
Model-generated anchors
0
Average confidence
—

Source anchors are injected deterministically. This is not a check of every statement in a Dok.

Agents query this hub

doklo.get_dok("AUTH-SIGNIN")

Email and password sign-in
5 steps · 4 rules · 5 criteria
is_stale: false
anchors: 19 files

search_doks · get_dok · list_doks

Cursor and Claude Code can use Doklo’s MCP tools to read Doks and their code references.

Storage

Your Hub lives in Doklo Cloud, reviewed here and used by agents and published docs. Sync back to your own git is on the roadmap.

On this Dok

User flowBusiness rulesAcceptance criteria

Evidence

19 source files recorded for this Dok.

View source files →

Document

Version 1

web · critical

About this status

Approved 2026-10-03. Approval and source freshness are separate facts.

Tracked source files match the recorded baseline.

Hub context & agents →