Skip to content

Show the sign-in page instead of crashing when a secret is missing - #8

Merged
playgrndlabs-bot merged 1 commit into
mainfrom
claude/project-thread-dqb448
Oct 12, 2026
Merged

playgrndlabs-bot merged 1 commit into
mainfrom
claude/project-thread-dqb448

Conversation

@playgrndlabs-bot

Copy link
Copy Markdown
Contributor

Before: on a Worker deployed without the DASHBOARD_PASSWORD secret, opening /login failed with Cloudflare error 1101, because the Worker read .length of an undefined value.

After: a missing secret counts as empty. /login shows "Sign-in is off: set the DASHBOARD_PASSWORD secret…", and the API keeps working. A missing MANAGEMENT_KEY reaches the entrypoint as an empty value, and the entrypoint already refuses that with a clear message.

How: src/env.ts marks both secrets optional, and src/cpa.ts defaults them to "". Found while moving the live gateway to the new sub2api Worker. npm run verify passes (55 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SAZpFXZ9DiMfmb5SiDqEi2


Generated by Claude Code

A Worker deployed without DASHBOARD_PASSWORD threw on /login (Cloudflare error 1101)
because the code read .length of undefined. Missing secrets now count as empty: /login
shows "Sign-in is off: set the DASHBOARD_PASSWORD secret" and the API keeps working.

Claude-Session: https://claude.ai/code/session_01SAZpFXZ9DiMfmb5SiDqEi2
@playgrndlabs-bot
playgrndlabs-bot merged commit 644ae51 into main Oct 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants