Skip to content

BE-DP-04 · The local stack's password and session rules, and E2E logins that follow them

ID BE-DP-04 · Level L0 · Pack Pack G2 · The schema the data phase maps v1 onto · Run order row 0a, after BE-DP-03 · Issue #162

The local stack refuses a password shorter than 8 characters or without a lowercase letter, an uppercase letter and a digit, and ends a session after 24 hours, as hosted Auth will (D51, R-ACC-60 to R-ACC-62). Self sign-up stays off (D50). The E2E logins' password follows the rules: 15 characters, with a lowercase letter, an uppercase letter and a digit, and they still sign in.

Auth has no maximum length, so the 15-character limit is apps/web's form's, not the stack's (D51's consequences). This step changes no file.

  • BE-DP-03 is logged clean, so main holds pack G2.
  • You are in ~/opleet-v2/opleet on main, and git status --short prints nothing.

1 · Restart the stack, so it reads config.toml's auth settings

Section titled “1 · Restart the stack, so it reads config.toml's auth settings”
Terminal window
pnpm supabase stop
pnpm supabase start
pnpm supabase db reset

2 · The E2E logins, with a password that follows the rules

Section titled “2 · The E2E logins, with a password that follows the rules”

The script keeps the password in .env.e2e when it follows the rules and makes a new one when it doesn't, such as the 24 characters it made before pack G2. It never prints it.

Terminal window
pnpm db:e2e-users
awk -F= '/^E2E_PASSWORD=/ { print length($2) }' .env.e2e

3 · What Auth refuses: a sign-up, and a weak password even from an admin

Section titled “3 · What Auth refuses: a sign-up, and a weak password even from an admin”

The second call uses the local stack's own secret key, which supabase status prints for this Mac only; it is not a staging or production secret.

Paste the block exactly as it is. Its first line, eval, fills in $API_URL, $PUBLISHABLE_KEY and $SECRET_KEY from your local stack; never replace them with values by hand, and never with staging's or production's.

Terminal window
eval "$(pnpm supabase status -o env)"
curl -s "$API_URL/auth/v1/signup" -H "apikey: $PUBLISHABLE_KEY" -H "content-type: application/json" -d '{"email":"nobody@e2e.opleet.test","password":"Abcdefg12"}'; echo
curl -s "$API_URL/auth/v1/admin/users" -H "apikey: $SECRET_KEY" -H "Authorization: Bearer $SECRET_KEY" -H "content-type: application/json" -d '{"email":"nobody@e2e.opleet.test","password":"abcdefg12","email_confirm":true}'; echo

4 · The E2E logins sign in, through apps/web

Section titled “4 · The E2E logins sign in, through apps/web”

Playwright starts the built app; it doesn't build it. So build from this main first, as CI does.

Terminal window
pnpm --filter web build
pnpm --filter web e2e
  • Block 1: "Started supabase local development setup", then "Finished supabase db reset".
  • Block 2: 11 lines starting made or kept, then 11 logins in the E2E organization, all pools. .env.e2e updated (password not shown)., and 15.
  • Block 3: the first line holds "error_code":"signup_disabled", the second "error_code":"weak_password": no lowercase-only password is accepted, and no login is made.
  • Block 4: next build finishes with its list of routes, then every spec passes, the sign-in ones and the error pages' included.
Terminal window
docker exec supabase_auth_opleet env | grep -E 'GOTRUE_PASSWORD_MIN_LENGTH|GOTRUE_PASSWORD_REQUIRED_CHARACTERS|GOTRUE_SESSIONS_TIMEBOX'

Three lines: GOTRUE_PASSWORD_MIN_LENGTH=8, GOTRUE_PASSWORD_REQUIRED_CHARACTERS= with the lowercase letters, the uppercase letters and the digits, and GOTRUE_SESSIONS_TIMEBOX=24h0m0s.

  • Block 2 prints a number other than 15: paste it into #162, never the password.
  • Block 2 stops with weak_password: the stack refused the script's password. Paste the error line.
  • Every errors.spec.ts spec fails, or a spec says /e2e-faults answers 404: apps/web wasn't built from this main, or another server holds port 3100. Stop any pnpm dev or next start you have running, then run the block again, the build included.
  • Block 4 fails at sign-in with invalid_credentials: run block 2 again, then block 4; if it still fails, paste the failing spec's name and its first error lines.
  • The Check shows no GOTRUE_SESSIONS_TIMEBOX: the stack started before pull. Run block 1 again.

Nothing to undo in the repository. pnpm db:e2e-users can be run again at any time: existing logins get the password in .env.e2e. Staging and production set their auth rules in the Dashboard, by a TL step (D51), never from config.toml.

Log each run as a comment on #162: date · who · result · notes, with the output of blocks 2 to 4 (never the password) and the Check.