Repository navigation
fix: respond 500 instead of crashing when login initiation fails - #15
Merged
Merged
Conversation
This was referenced Aug 15, 2026
Collaborator
Author
|
CI here fails only on the audit step — advisories pre-dating this branch (main fails identically). #17 clears them; update this branch after it merges and CI should go green. |
createLoginHandler's promise chain ended in a terminal
`.catch((error) => { throw error })` — rethrowing inside a terminal
catch produces an unhandled promise rejection, which terminates the
Node process. Any failure while initiating an interactive login (e.g.
a transient Entra metadata fetch error inside getAuthCodeUrl) was
reachable by an anonymous GET and took the whole server down.
Log the error via the configured logger and respond 500, matching
createAuthHandler's error handling. The logger is now threaded through
to createLoginHandler for this purpose.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cuzzlor
force-pushed
the
fix/login-unhandled-rejection
branch
from
August 15, 2026 09:43
b139384 to
437ffd3
Compare
mderriey
approved these changes
Aug 16, 2026
cuzzlor
added a commit
that referenced
this pull request
Aug 16, 2026
`npm audit fix` resolves 23 of the 24 advisories accumulated since the last release (vite, shell-quote, qs, fast-uri, launch-editor, etc. — all transitive devDependencies; nothing shipped changes). The remaining low-severity advisory (GHSA-g7r4-m6w7-qqqr, esbuild 0.27.3–0.28.0 dev-server file read on Windows) has no in-range fix via tsx/vite yet, so it gets an .nsprc exception with removal notes — esbuild is only used here as a build/test transform, never as a dev server. The stale uuid exception (fixed by the update) is removed. Unblocks CI for #15 and #16, which fail on the audit step for advisories predating those branches. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
createLoginHandler's promise chain ends in a terminal.catch((error) => { throw error }). Rethrowing inside a terminal catch converts the error into an unhandled promise rejection, which terminates the Node process (default behaviour since Node 15).Any failure while initiating an interactive login — e.g. a transient Entra metadata fetch error inside
msalClient.getAuthCodeUrl, or a throwingauthorizationUrlRequestOverride— is reachable by an anonymousGETwithaccept: text/html, so a single request during an Entra blip takes the whole server down.Fix
Log the error via the configured logger and respond
500, matchingcreateAuthHandler's existing error handling.loggeris now threaded throughAuthInputtocreateLoginHandlerfor this purpose (no public API change —AuthConfigalready haslogger).Testing
Added
src/login-handler.spec.ts(first tests in the repo —vitestwas already wired up):npm run lint,npm run check-types, andnpm testall pass.🤖 Generated with Claude Code