fix: prevent server error on invalid /auth/failure requests#1552
Merged
YasharF merged 3 commits intosahat:masterfrom Feb 17, 2026
Merged
fix: prevent server error on invalid /auth/failure requests#1552YasharF merged 3 commits intosahat:masterfrom
YasharF merged 3 commits intosahat:masterfrom
Conversation
- The /auth/failure route attempted to set the redirect response twice, causing Express to log a server error. The fix returns immediately after the first redirect. - Added test cases to verify that GET requests to core routes do not cause unintended server-side errors. - Removed the /api test case from app.test.js to keep the tests focused on core application routes, as the /api route is likely to be removed during customization.
There was a problem hiding this comment.
Pull request overview
This PR fixes an Express error on invalid /auth/failure requests by preventing a second redirect attempt, and updates the route smoke tests to include additional core GET endpoints.
Changes:
- Add an early
returnafter redirecting in/auth/failureto avoid attempting to set the response twice. - Update
test/app.test.jsby removing the/apiroute check and adding a broader “core GET routes” smoke suite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app.js |
Prevents double-redirect in /auth/failure by returning immediately after redirecting to /. |
test/app.test.js |
Reworks route-level tests by removing /api and adding a core GET route smoke loop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Checklist
--no-verifywas not used for the commit(s)npm run lintpassed locally without any errorsnpm testpassed locally without any errorsnpm run test:e2e:replaypassed locally without any errorsnpm run test:e2e:custom -- --project=chromium-nokey-livepassed locally without any errorsDescription
Screenshots of UI changes (browser) and logs/test results (console, terminal, shell, cmd)