Repository navigation
Show the sign-in page instead of crashing when a secret is missing - #8
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: on a Worker deployed without the
DASHBOARD_PASSWORDsecret, opening/loginfailed with Cloudflare error 1101, because the Worker read.lengthof an undefined value.After: a missing secret counts as empty.
/loginshows "Sign-in is off: set the DASHBOARD_PASSWORD secret…", and the API keeps working. A missingMANAGEMENT_KEYreaches the entrypoint as an empty value, and the entrypoint already refuses that with a clear message.How:
src/env.tsmarks both secrets optional, andsrc/cpa.tsdefaults them to"". Found while moving the live gateway to the newsub2apiWorker.npm run verifypasses (55 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01SAZpFXZ9DiMfmb5SiDqEi2
Generated by Claude Code