Skip to content

fix: prevent server error on invalid /auth/failure requests#1552

Merged
YasharF merged 3 commits intosahat:masterfrom
YasharF:master
Feb 17, 2026
Merged

fix: prevent server error on invalid /auth/failure requests#1552
YasharF merged 3 commits intosahat:masterfrom
YasharF:master

Conversation

@YasharF
Copy link
Collaborator

@YasharF YasharF commented Feb 17, 2026

Checklist

  • I acknowledge that submissions that include copy-paste of AI-generated content taken at face value (PR text, code, commit message, documentation, etc.) most likely have errors and hence will be rejected entirely and marked as spam or invalid
  • I manually tested the change with a running instance, DB, and valid API keys where applicable
  • Added/updated tests if the existing tests do not cover this change
  • README or other relevant docs are updated
  • --no-verify was not used for the commit(s)
  • npm run lint passed locally without any errors
  • npm test passed locally without any errors
  • npm run test:e2e:replay passed locally without any errors
  • npm run test:e2e:custom -- --project=chromium-nokey-live passed locally without any errors
  • PR diff does not include unrelated changes
  • PR title follows Conventional Commits — https://www.conventionalcommits.org/en

Description

  • 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.

Screenshots of UI changes (browser) and logs/test results (console, terminal, shell, cmd)

image image image

- 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.
Copilot AI review requested due to automatic review settings February 17, 2026 19:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return after redirecting in /auth/failure to avoid attempting to set the response twice.
  • Update test/app.test.js by removing the /api route 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@YasharF YasharF merged commit 891ef80 into sahat:master Feb 17, 2026
2 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