Skip to content

Commit 9d01b6c

Browse files
committed
PR_26169_auth-preview-signin-regression
Fix preview sign-in fallback blocking Supabase authentication.
1 parent 994699e commit 9d01b6c

11 files changed

Lines changed: 1548 additions & 763 deletions

docs_build/dev/codex_commands.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,3 +2679,38 @@ Required reports:
26792679

26802680
Packaging:
26812681
- `tmp/PR_26168_247-memberships-page_delta.zip`
2682+
2683+
2684+
## PR_26169_auth-preview-signin-regression
2685+
2686+
Changes:
2687+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2688+
- Verified the current branch is `main`.
2689+
- Reviewed `account/sign-in.html`, `assets/theme-v2/js/login-session.js`, `assets/theme-v2/js/account-auth-service.js`, `assets/theme-v2/js/account-auth-actions.js`, and the Local API auth routes.
2690+
- Changed `/api/auth/status` to report browser action availability from Supabase Auth configuration instead of strict operator preflight readiness.
2691+
- Changed sign-in, create-account, and password-reset action gates to attempt the configured Supabase Auth provider when browser-safe auth config is present.
2692+
- Kept strict connectivity and identity-table checks on operator preflight and post-auth session/identity resolution.
2693+
- Preserved preview fallback behavior when Supabase Auth browser-safe config is missing.
2694+
- Updated targeted Node and Playwright auth tests for config-gated status, safe identity failures, and real Supabase Auth calls.
2695+
2696+
Validation:
2697+
- `node --check src/dev-runtime/server/local-api-router.mjs`
2698+
- `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
2699+
- `node --check tests/playwright/tools/LoginSessionMode.spec.mjs`
2700+
- `node --test --test-name-pattern "Missing Supabase config|Configured Supabase Auth enables sign-in attempt before identity readiness|Account auth routes call external Supabase Auth|Default Supabase Auth routes call external auth|Supabase account actions fail actionably when identity tables are missing|Operator auth preflight reports failed Supabase connectivity" tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
2701+
- `node node_modules/@playwright/test/cli.js test tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Sign-in page uses a production-safe|Configured account auth actions" --project=playwright --workers=1 --reporter=line`
2702+
- `node node_modules/@playwright/test/cli.js test tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs --project=playwright --workers=1 --reporter=line`
2703+
- `node scripts/validate-browser-env-agnostic.mjs` reported existing product-data route guardrail failures in `local-api-router.mjs`.
2704+
- `git diff --check`
2705+
- Full samples smoke skipped because samples and `start_of_day` folders were not touched.
2706+
2707+
Required reports:
2708+
- `docs_build/dev/reports/codex_review.diff`
2709+
- `docs_build/dev/reports/codex_changed_files.txt`
2710+
- `docs_build/dev/reports/PR_26169_auth-preview-signin-regression.md`
2711+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2712+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2713+
- `docs_build/dev/reports/environment_agnostic_browser_gate_report.md`
2714+
2715+
Packaging:
2716+
- `tmp/PR_26169_auth-preview-signin-regression_delta.zip`

docs_build/dev/commit_comment.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PR_26168_247-memberships-page
2-
Add public Memberships page with Free, Creator, and Studio tiers.
1+
PR_26169_auth-preview-signin-regression
2+
Fix preview sign-in fallback blocking Supabase authentication.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26169_auth-preview-signin-regression
2+
3+
## Branch Validation
4+
- PASS - Current branch is `main`.
5+
6+
## Summary
7+
- Fixed the preview fallback regression by changing `/api/auth/status` to report account action availability from configured Supabase Auth browser-safe env, not strict operator preflight readiness.
8+
- Sign In, Create Account, and Password Reset now reach the configured Supabase Auth adapter when config is present.
9+
- Strict Supabase connectivity and identity-table readiness checks remain on operator preflight and post-auth session/identity resolution.
10+
- Missing Supabase Auth config still shows the safe preview fallback message.
11+
12+
## Requirement Checklist
13+
- PASS - Reviewed `/account/sign-in.html` and related auth JS.
14+
- PASS - Root cause identified: `/api/auth/status` used `authStatusForRoute()`, which ran live connectivity and identity readiness checks before enabling the form.
15+
- PASS - Safe fallback preserved when no Supabase Auth provider/config is available.
16+
- PASS - Supabase config present enables Sign In and attempts real Supabase Auth.
17+
- PASS - Create Account and Password Reset links remain wired and covered by Playwright.
18+
- PASS - Existing operator preflight/toggle activation behavior remains strict and reports failed connectivity.
19+
- PASS - Guest/static browsing support remains available.
20+
- PASS - No memberships, legal, billing, marketplace, database schema, or backend enforcement changes.
21+
- PASS - No secrets or passwords exposed in responses or tests.
22+
23+
## Validation Lanes
24+
- PASS - `node --check src/dev-runtime/server/local-api-router.mjs`
25+
- PASS - `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
26+
- PASS - `node --check tests/playwright/tools/LoginSessionMode.spec.mjs`
27+
- PASS - Targeted Node auth route validation:
28+
`node --test --test-name-pattern "Missing Supabase config|Configured Supabase Auth enables sign-in attempt before identity readiness|Account auth routes call external Supabase Auth|Default Supabase Auth routes call external auth|Supabase account actions fail actionably when identity tables are missing|Operator auth preflight reports failed Supabase connectivity" tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
29+
- PASS - Targeted Playwright sign-in behavior:
30+
`node node_modules/@playwright/test/cli.js test tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Sign-in page uses a production-safe|Configured account auth actions" --project=playwright --workers=1 --reporter=line`
31+
- PASS - Static-only account API fallback:
32+
`node node_modules/@playwright/test/cli.js test tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs --project=playwright --workers=1 --reporter=line`
33+
- PASS - `git diff --check` before generating `codex_review.diff`; final check also passed with `docs_build/dev/reports/codex_review.diff` excluded because the generated diff artifact contains diff-context whitespace.
34+
- FAIL - `node scripts/validate-browser-env-agnostic.mjs` still reports existing product-data route guardrail findings in `src/dev-runtime/server/local-api-router.mjs`; no auth-specific account service findings were reported.
35+
36+
## Manual Validation Notes
37+
- With Supabase Auth URL and anon key present, `/api/auth/status` returns ready and the Sign In page enables the submit button.
38+
- In the targeted test fixture without a configured Postgres database, Sign In calls `/auth/v1/token?grant_type=password` and then shows the safe identity setup failure.
39+
- Without Supabase Auth config, the Sign In button remains disabled and shows: `Sign In is not available in this preview. You can continue browsing.`
40+
- Password Reset reaches Supabase Auth and returns the expected safe success copy.
41+
- The Playwright fixture logs known missing product-data/database resource noise for platform banner and expected 503 auth identity failures; no browser page errors were observed.
42+
- Runtime startup still reads `.env`; `.env.local` was not modified and no secrets were printed.
Lines changed: 11 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,11 @@
1-
# Codex Changed Files
2-
3-
## git status --short (PR-scoped)
4-
5-
M assets/theme-v2/js/gamefoundry-partials.js
6-
M assets/theme-v2/partials/footer.html
7-
M assets/theme-v2/partials/header-nav.html
8-
M docs_build/dev/codex_commands.md
9-
M docs_build/dev/commit_comment.txt
10-
M docs_build/dev/reports/codex_changed_files.txt
11-
M docs_build/dev/reports/codex_review.diff
12-
M docs_build/dev/reports/filesystem_scan_reduction_report.md
13-
M docs_build/dev/reports/playwright_discovery_ownership_report.md
14-
M docs_build/dev/reports/playwright_discovery_scope_report.md
15-
M docs_build/dev/reports/playwright_structure_audit.md
16-
M src/dev-runtime/admin/header-nav.local.html
17-
M tests/playwright/tools/RootToolsFutureState.spec.mjs
18-
?? docs_build/dev/reports/PR_26168_247-memberships-page.md
19-
?? memberships/index.html
20-
?? tests/playwright/tools/PublicMembershipsPage.spec.mjs
21-
22-
## git diff --stat (PR-scoped)
23-
24-
assets/theme-v2/js/gamefoundry-partials.js | 3 +-
25-
assets/theme-v2/partials/footer.html | 1 +
26-
assets/theme-v2/partials/header-nav.html | 8 ++++-
27-
docs_build/dev/codex_commands.md | 36 ++++++++++++++++++++++
28-
docs_build/dev/commit_comment.txt | 3 +-
29-
.../reports/filesystem_scan_reduction_report.md | 2 +-
30-
.../playwright_discovery_ownership_report.md | 6 ++--
31-
.../reports/playwright_discovery_scope_report.md | 6 ++--
32-
.../dev/reports/playwright_structure_audit.md | 8 ++---
33-
src/dev-runtime/admin/header-nav.local.html | 8 ++++-
34-
.../playwright/tools/RootToolsFutureState.spec.mjs | 4 +--
35-
11 files changed, 65 insertions(+), 20 deletions(-)
36-
.../dev/reports/PR_26168_247-memberships-page.md | 90 ++++++++++++++++++++++
37-
1 file changed, 90 insertions(+)
38-
/dev/null => memberships/index.html | 122 ++++++++++++++++++++++++++++++++++++
39-
1 file changed, 122 insertions(+)
40-
.../tools/PublicMembershipsPage.spec.mjs | 110 +++++++++++++++++++++
41-
1 file changed, 110 insertions(+)
42-
docs_build/dev/reports/codex_changed_files.txt | 108 +-
43-
docs_build/dev/reports/codex_review.diff | 1918 +++++++-----------------
44-
2 files changed, 603 insertions(+), 1423 deletions(-)
45-
46-
## Full working tree note
47-
48-
- Unrelated pre-existing working tree change remains: `D test.sql` (excluded from PR diff and ZIP).
49-
50-
## Full git status --short
51-
52-
M assets/theme-v2/js/gamefoundry-partials.js
53-
M assets/theme-v2/partials/footer.html
54-
M assets/theme-v2/partials/header-nav.html
55-
M docs_build/dev/codex_commands.md
56-
M docs_build/dev/commit_comment.txt
57-
M docs_build/dev/reports/codex_changed_files.txt
58-
M docs_build/dev/reports/codex_review.diff
59-
M docs_build/dev/reports/filesystem_scan_reduction_report.md
60-
M docs_build/dev/reports/playwright_discovery_ownership_report.md
61-
M docs_build/dev/reports/playwright_discovery_scope_report.md
62-
M docs_build/dev/reports/playwright_structure_audit.md
63-
M src/dev-runtime/admin/header-nav.local.html
64-
D test.sql
65-
M tests/playwright/tools/RootToolsFutureState.spec.mjs
66-
?? docs_build/dev/reports/PR_26168_247-memberships-page.md
67-
?? memberships/index.html
68-
?? tests/playwright/tools/PublicMembershipsPage.spec.mjs
1+
docs_build/dev/codex_commands.md
2+
docs_build/dev/commit_comment.txt
3+
docs_build/dev/reports/PR_26169_auth-preview-signin-regression.md
4+
docs_build/dev/reports/codex_changed_files.txt
5+
docs_build/dev/reports/codex_review.diff
6+
docs_build/dev/reports/coverage_changed_js_guardrail.txt
7+
docs_build/dev/reports/environment_agnostic_browser_gate_report.md
8+
docs_build/dev/reports/playwright_v8_coverage_report.txt
9+
src/dev-runtime/server/local-api-router.mjs
10+
tests/dev-runtime/SupabaseProviderContractStub.test.mjs
11+
tests/playwright/tools/LoginSessionMode.spec.mjs

0 commit comments

Comments
 (0)