New account registration
Visitors create a new account on the /register screen by supplying a name, email and password; a successful submission creates a MEMBER-role account, starts a 7-day session, and signs the visitor in immediately. Invalid input or an already-registered email is rejected with a specific error instead of creating an account.
Document details · v1
Drift detectedapp/register/actions.ts — This dok may no longer match the code beneath it.
User flow
2user
Switch the authentication panel to registration mode
ResultThe form reveals a name field in addition to email and password, and the panel heading reads "register" (register).
Interaction details
- all · click
user
Submit name, email and password to create a new account
ResultThe request is sent to the sign-up action with the entered name, email and password.
Interaction details
- all · submit
Business rules
4Policies and constraints the product must keep.
- 01ValidationBR-AUTH-SIGNUP-01
Registration requires a name between 2 and 40 trimmed characters, an email matching a standard local@domain.tld pattern, and a password between 8 and 128 characters; otherwise the request is rejected with status 400 and error code VALIDATION.
Read linked criteria here
- AC-AUTH-SIGNUP-01When a visitor submits a name of 2-40 characters, a valid-format email, and a password of 8-128 characters that is not already registered, the account is created with role MEMBER, a session cookie is set, and the response is ok:true with status 200.
- AC-AUTH-SIGNUP-03When the name, email format, or password length fails the stated bounds, the response is ok:false with status 400 and error code VALIDATION, and no account is created.
- 02RestrictionBR-AUTH-SIGNUP-02
The email address (trimmed and lower-cased) must be unique among existing accounts; registering with an email already in use is rejected with status 409 and error code EMAIL_EXISTS.
Linked criteria 1Criterion 02Read linked criteria here
- AC-AUTH-SIGNUP-02When the submitted email already belongs to an existing account, the response is ok:false with status 409 and error code EMAIL_EXISTS, and no new account is created.
- 03PolicyBR-AUTH-SIGNUP-03
Every account created through registration is assigned the MEMBER role; no other role can be selected at signup.
Linked criteria 1Criterion 01Read linked criteria here
- AC-AUTH-SIGNUP-01When a visitor submits a name of 2-40 characters, a valid-format email, and a password of 8-128 characters that is not already registered, the account is created with role MEMBER, a session cookie is set, and the response is ok:true with status 200.
- 04PolicyBR-AUTH-SIGNUP-04
A successful registration immediately starts an authenticated session for the new account via a 7-day (604800-second) httpOnly session cookie, and any unexpected failure not covered by a known validation or duplication error returns status 500 with error code INTERNAL.
Read linked criteria here
- AC-AUTH-SIGNUP-01When a visitor submits a name of 2-40 characters, a valid-format email, and a password of 8-128 characters that is not already registered, the account is created with role MEMBER, a session cookie is set, and the response is ok:true with status 200.
- AC-AUTH-SIGNUP-04After a successful registration the session cookie expires after 7 days (604800 seconds), after which the visitor must sign in again.
Acceptance criteria
4Expected outcomes. These entries do not claim a test was run or passed.
- 01CriterionAC-AUTH-SIGNUP-01
When a visitor submits a name of 2-40 characters, a valid-format email, and a password of 8-128 characters that is not already registered, the account is created with role MEMBER, a session cookie is set, and the response is ok:true with status 200.
- 02CriterionAC-AUTH-SIGNUP-02
When the submitted email already belongs to an existing account, the response is ok:false with status 409 and error code EMAIL_EXISTS, and no new account is created.
Linked rules 1Rule 02 - 03CriterionAC-AUTH-SIGNUP-03
When the name, email format, or password length fails the stated bounds, the response is ok:false with status 400 and error code VALIDATION, and no account is created.
Linked rules 1Rule 01 - 04CriterionAC-AUTH-SIGNUP-04
After a successful registration the session cookie expires after 7 days (604800 seconds), after which the visitor must sign in again.
Linked rules 1Rule 04
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.tschanged
- auth.mjs
- actionView.ts
Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.
