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
User flow
3user
View the sign-in form to access the application
ResultThe 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
user
Submit email and password to sign in
ResultThe 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
user
Sign in instantly using one of the provided demo accounts
ResultThe 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
4Policies 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 03Read 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.
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 01Read 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 01Read 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
5Expected outcomes. These entries do not claim a test was run or passed.
- 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.
- 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 - 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 - 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 - 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.
