Skip to content

fix: auth loop between web dashboard and api subdomains - #1640

Merged
LucasSantana-Dev merged 4 commits into
mainfrom
fix/auth-loop-hotfix
Jun 28, 2026
Merged

LucasSantana-Dev merged 4 commits into
mainfrom
fix/auth-loop-hotfix

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Jun 28, 2026 •

Copy link
Copy Markdown
Owner

Description

Hotfix for production auth loop: web dashboard redirects to OAuth and returns to landing page in an infinite loop.

Root cause: Session cookie uses SameSite=Lax, which browsers don't send on credentialed JS fetch() between subdomains (lucky.lucassantana.tech → lucky-api.lucassantana.tech) in certain conditions (ITP, Lax enforcement edge cases). After OAuth redirects back to the frontend, the SPA's checkAuth() fetch doesn't carry the session cookie, so the user appears unauthenticated and ends up back on the landing page.

Fix (two layers):

  1. session.ts — Set sameSite: 'none' in production (with existing secure: true as required by the spec). In development, keep sameSite: 'lax' for localhost compat. This ensures the cookie is consistently sent on credentialed cross-subdomain requests.

  2. api.ts — Add a 30s sessionStorage cooldown to the 401 redirect interceptor. If a redirect was already attempted within the last 30 seconds, don't redirect again. This breaks the infinite loop as a safety net.

Checklist

  • Tests pass locally (pre-existing @lucky/shared/utils resolution issue in jest — same 6 failures on clean main)
  • CHANGELOG.md updated (if user-facing)
  • TypeScript builds cleanly (both backend + frontend)

Destructive / irreversible interaction (Tier A)

Skip — no irreversible Discord action added.

Feature-removal sweep

Skip — no feature removed.


Summary by cubic

Fixes the production OAuth redirect loop between the dashboard and API by sending the session cookie across subdomains and adding a 30s redirect cooldown. Also adds ADRs documenting ESLint legacy config cleanup and standardizing tests on Vitest.

  • Bug Fixes
    • packages/backend: Set session cookie sameSite to 'none' in production (keeps secure: true); 'lax' in development.
    • packages/frontend: Add a 30s sessionStorage cooldown in the 401 interceptor before redirecting to ${NORMALIZED_API_BASE}/auth/discord.
    • packages/backend: Update integration tests to expect SameSite=None in production and add unit tests to lock the sameSite toggle.

Written for commit 5861675. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted session cookie SameSite for production so it uses None (instead of Lax).
    • Prevented repeated OAuth/Discord redirect loops by adding a short cooldown between redirect attempts.
  • Documentation
    • Updated frontend lint setup guidance to match the current configuration.
    • Added project notes for standardizing the test runner to Vitest.
  • Tests
    • Expanded unit and integration coverage for the production/dev session cookie SameSite behavior.

Change session cookie sameSite to 'none' in production so the cookie is
sent on credentialed JS fetch() across subdomains (lucky.* →
lucky-api.*). Add 30s cooldown guard to the 401 interceptor to prevent
redirect loops.

- session.ts: sameSite: isProduction ? 'none' : 'lax'
- api.ts: sessionStorage-based redirect cooldown
- session.test.ts: SameSite regression tests
@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Three areas change: backend session cookies now use environment-dependent sameSite, frontend 401 redirects add a 30-second cooldown via sessionStorage, and two ADRs document ESLint cleanup plus a Jest-to-Vitest migration plan.

Changes

Session & Auth Fixes

Layer / File(s) Summary
Environment-aware sameSite and tests
packages/backend/src/middleware/session.ts, packages/backend/tests/unit/middleware/session.test.ts
sameSite is set to 'none' in production and 'lax' otherwise; two tests verify the conditional expression in each environment.
401 redirect cooldown
packages/frontend/src/services/api.ts
The Axios 401 interceptor reads auth_redirect_ts from sessionStorage and only redirects to the Discord auth endpoint if more than 30 seconds have elapsed since the last redirect.

Architecture Decision Records

Layer / File(s) Summary
ESLint legacy config cleanup ADR
decisions/2026-06-27-eslint-legacy-config-cleanup.md
Documents the plan to add react-refresh/only-export-components to the flat config, delete dead .eslintrc.cjs files, update the ignore list, and update docs/FRONTEND.md.
Jest-to-Vitest standardization ADR
decisions/2026-06-27-standardize-test-runner-vitest.md
Documents a two-phase migration plan, codemods, Stryker updates, technical concerns, alternatives, and fallback strategy.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • LucasSantana-Dev/Lucky#133: Both PRs modify backend session/OAuth cookie handling in proxied/production contexts; that PR adjusts proxy trust and secure cookie expectations while this PR changes sameSite based on NODE_ENV.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR does not update @sentry/node to 9.42.1, so it misses the linked issue's primary requirement. Add the @sentry/node 9.16.1→9.42.1 bump and keep the patch focused on that dependency upgrade.
Out of Scope Changes check ⚠️ Warning Several changes are unrelated to the linked Sentry upgrade, including auth-loop logic, cookie behavior, tests, and ADR docs. Remove or split out the auth/session and ADR changes so the PR only contains the Sentry dependency upgrade.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main code change: fixing the auth redirect loop between the dashboard and API subdomains.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auth-loop-hotfix

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@github-actions

Copy link
Copy Markdown

Size Change: +135 B (+0.03%)

Total Size: 472 kB

📦 View Changed
Filename Size Change
packages/frontend/dist/assets/Admin-B24bvksF.js 0 B -2.3 kB (removed) 🏆
packages/frontend/dist/assets/Admin-CfPTS8GB.js 2.3 kB +2.3 kB (new file) 🆕
packages/frontend/dist/assets/AdminSupport-CCpfv-O_.js 0 B -1.6 kB (removed) 🏆
packages/frontend/dist/assets/AdminSupport-CFQ1ITgM.js 1.6 kB +1.6 kB (new file) 🆕
packages/frontend/dist/assets/api-B1lHOZZ9.js 4.01 kB +4.01 kB (new file) 🆕
packages/frontend/dist/assets/api-ESvLnxfL.js 0 B -3.93 kB (removed) 🏆
packages/frontend/dist/assets/AutoMessages-CpuMTkOl.js 0 B -2.65 kB (removed) 🏆
packages/frontend/dist/assets/AutoMessages-jg-BXHJg.js 2.65 kB +2.65 kB (new file) 🆕
packages/frontend/dist/assets/AutoMod-DTfdPGVU.js 0 B -4.19 kB (removed) 🏆
packages/frontend/dist/assets/AutoMod-kFGyxTK8.js 4.19 kB +4.19 kB (new file) 🆕
packages/frontend/dist/assets/badge-BdAf2d4A.js 500 B +500 B (new file) 🆕
packages/frontend/dist/assets/badge-BX8hxxIi.js 0 B -501 B (removed) 🏆
packages/frontend/dist/assets/BatchJobs-BfdJkjo8.js 3.72 kB +3.72 kB (new file) 🆕
packages/frontend/dist/assets/BatchJobs-CxVo6aK2.js 0 B -3.71 kB (removed) 🏆
packages/frontend/dist/assets/Card-CMiAZ4pJ.js 508 B +508 B (new file) 🆕
packages/frontend/dist/assets/Card-DD-EtLnT.js 0 B -505 B (removed) 🏆
packages/frontend/dist/assets/Changelog-dMDBoiGu.js 39.1 kB +39.1 kB (new file) 🆕
packages/frontend/dist/assets/Changelog-DnddO0P5.js 0 B -39.1 kB (removed) 🏆
packages/frontend/dist/assets/CommandsConfig-6T19VEqq.js 0 B -1.5 kB (removed) 🏆
packages/frontend/dist/assets/CommandsConfig-D-CsATSd.js 1.5 kB +1.5 kB (new file) 🆕
packages/frontend/dist/assets/Config-CttTNgZT.js 1.98 kB +1.98 kB (new file) 🆕
packages/frontend/dist/assets/Config-CWwl9YBB.js 0 B -1.97 kB (removed) 🏆
packages/frontend/dist/assets/CustomCommands-C3C6wJJO.js 2.12 kB +2.12 kB (new file) 🆕
packages/frontend/dist/assets/CustomCommands-D_V3sdTV.js 0 B -2.12 kB (removed) 🏆
packages/frontend/dist/assets/DashboardOverview-DNSnNm1C.js 3.95 kB +3.95 kB (new file) 🆕
packages/frontend/dist/assets/DashboardOverview-gjDT8qNA.js 0 B -3.95 kB (removed) 🏆
packages/frontend/dist/assets/dialog-BYECP4Z3.js 0 B -959 B (removed) 🏆
packages/frontend/dist/assets/dialog-TxiMDtIv.js 958 B +958 B (new file) 🆕
packages/frontend/dist/assets/Docs-BU8yWOO6.js 0 B -17.6 kB (removed) 🏆
packages/frontend/dist/assets/Docs-DJv4JYHG.js 17.6 kB +17.6 kB (new file) 🆕
packages/frontend/dist/assets/DocsShell-4yxLktM8.js 1.42 kB +1.42 kB (new file) 🆕
packages/frontend/dist/assets/DocsShell-BLdzRt6y.js 0 B -1.42 kB (removed) 🏆
packages/frontend/dist/assets/EmbedBuilder-C-Z2FG0d.js 3.28 kB +3.28 kB (new file) 🆕
packages/frontend/dist/assets/EmbedBuilder-LM2gfHPN.js 0 B -3.28 kB (removed) 🏆
packages/frontend/dist/assets/Features-BbGNsB_i.js 0 B -754 B (removed) 🏆
packages/frontend/dist/assets/Features-BdSpmrBH.js 753 B +753 B (new file) 🆕
packages/frontend/dist/assets/GuildAutomation-Bz07YZzp.js 2.89 kB +2.89 kB (new file) 🆕
packages/frontend/dist/assets/GuildAutomation-DpuNHzrL.js 0 B -2.88 kB (removed) 🏆
packages/frontend/dist/assets/index-BVLdgNRm.js 70.3 kB +70.3 kB (new file) 🆕
packages/frontend/dist/assets/index-CzC1C_o4.js 0 B -70.3 kB (removed) 🏆
packages/frontend/dist/assets/input-DMBS2_P_.js 0 B -466 B (removed) 🏆
packages/frontend/dist/assets/input-L_Qq1uLw.js 463 B +463 B (new file) 🆕
packages/frontend/dist/assets/label-CaJADrbY.js 475 B +475 B (new file) 🆕
packages/frontend/dist/assets/label-CpqOZMoY.js 0 B -477 B (removed) 🏆
packages/frontend/dist/assets/Landing-B3DcgUDc.js 0 B -5.2 kB (removed) 🏆
packages/frontend/dist/assets/Landing-DJqPb-hI.js 5.2 kB +5.2 kB (new file) 🆕
packages/frontend/dist/assets/LastFm-BBsDQNsG.js 0 B -1.74 kB (removed) 🏆
packages/frontend/dist/assets/LastFm-BmP6ygqY.js 1.74 kB +1.74 kB (new file) 🆕
packages/frontend/dist/assets/Levels-CfEkwbMe.js 2.27 kB +2.27 kB (new file) 🆕
packages/frontend/dist/assets/Levels-CnydHG70.js 0 B -2.27 kB (removed) 🏆
packages/frontend/dist/assets/Login-CVnqtlC8.js 2.5 kB +2.5 kB (new file) 🆕
packages/frontend/dist/assets/Login-DJrgPSlU.js 0 B -2.5 kB (removed) 🏆
packages/frontend/dist/assets/Lyrics-BmDR7VzF.js 1.34 kB +1.34 kB (new file) 🆕
packages/frontend/dist/assets/Lyrics-CGzzfCED.js 0 B -1.34 kB (removed) 🏆
packages/frontend/dist/assets/Moderation-C2SwmzCG.js 0 B -3.79 kB (removed) 🏆
packages/frontend/dist/assets/Moderation-Dv8fFBBh.js 3.79 kB +3.79 kB (new file) 🆕
packages/frontend/dist/assets/Music-BpN41kG-.js 5.97 kB +5.97 kB (new file) 🆕
packages/frontend/dist/assets/Music-C-KqvrXJ.js 0 B -5.97 kB (removed) 🏆
packages/frontend/dist/assets/MusicConfig-BeNQgXU7.js 1.65 kB +1.65 kB (new file) 🆕
packages/frontend/dist/assets/MusicConfig-CNhD3T1Z.js 0 B -1.65 kB (removed) 🏆
packages/frontend/dist/assets/PreferredArtists-D_uwmDv7.js 3.72 kB +3.72 kB (new file) 🆕
packages/frontend/dist/assets/PreferredArtists-DJ7USfkt.js 0 B -3.72 kB (removed) 🏆
packages/frontend/dist/assets/PrivacyPolicy-DFYhPovm.js 0 B -1.77 kB (removed) 🏆
packages/frontend/dist/assets/PrivacyPolicy-K22duAyP.js 1.77 kB +1.77 kB (new file) 🆕
packages/frontend/dist/assets/ReactionRoles-DaIdFoWI.js 9.02 kB +9.02 kB (new file) 🆕
packages/frontend/dist/assets/ReactionRoles-DlXEhtEV.js 0 B -9.02 kB (removed) 🏆
packages/frontend/dist/assets/Roles-BjHqCm88.js 0 B -3.34 kB (removed) 🏆
packages/frontend/dist/assets/Roles-DcTE8v1A.js 3.34 kB +3.34 kB (new file) 🆕
packages/frontend/dist/assets/SectionHeader-BNoArnTM.js 893 B +893 B (new file) 🆕
packages/frontend/dist/assets/SectionHeader-W3iURIc9.js 0 B -895 B (removed) 🏆
packages/frontend/dist/assets/select-QcLmvf4B.js 0 B -1.23 kB (removed) 🏆
packages/frontend/dist/assets/select-ukmdGoWC.js 1.23 kB +1.23 kB (new file) 🆕
packages/frontend/dist/assets/ServerLogs-1ZhshdMu.js 3.04 kB +3.04 kB (new file) 🆕
packages/frontend/dist/assets/ServerLogs-R0Au_eib.js 0 B -3.04 kB (removed) 🏆
packages/frontend/dist/assets/ServerSettings-CmyK9axh.js 0 B -3.99 kB (removed) 🏆
packages/frontend/dist/assets/ServerSettings-DyTiPvQ7.js 3.99 kB +3.99 kB (new file) 🆕
packages/frontend/dist/assets/ServersPage-D5tPNoHA.js 3.04 kB +3.04 kB (new file) 🆕
packages/frontend/dist/assets/ServersPage-eYnzmGTY.js 0 B -3.04 kB (removed) 🏆
packages/frontend/dist/assets/Skeleton-Bf4aqeVP.js 0 B -235 B (removed) 🏆
packages/frontend/dist/assets/Skeleton-DBKSOrEL.js 233 B +233 B (new file) 🆕
packages/frontend/dist/assets/Spotify-CptuIteo.js 0 B -1.75 kB (removed) 🏆
packages/frontend/dist/assets/Spotify-DiJGaTW0.js 1.75 kB +1.75 kB (new file) 🆕
packages/frontend/dist/assets/Starboard-BAMB31jl.js 1.82 kB +1.82 kB (new file) 🆕
packages/frontend/dist/assets/Starboard-BmyxCDGn.js 0 B -1.82 kB (removed) 🏆
packages/frontend/dist/assets/StatTile-B4dVYPkE.js 639 B +639 B (new file) 🆕
packages/frontend/dist/assets/StatTile-D0sEDTZi.js 0 B -638 B (removed) 🏆
packages/frontend/dist/assets/Support-CY00lWG0.js 0 B -1.56 kB (removed) 🏆
packages/frontend/dist/assets/Support-Dai8xlCq.js 1.55 kB +1.55 kB (new file) 🆕
packages/frontend/dist/assets/switch-CqrPY3ls.js 0 B -541 B (removed) 🏆
packages/frontend/dist/assets/switch-D9r5MrQ-.js 542 B +542 B (new file) 🆕
packages/frontend/dist/assets/TermsOfService-CTxB_Y-i.js 0 B -1.59 kB (removed) 🏆
packages/frontend/dist/assets/TermsOfService-CzZavC3P.js 1.59 kB +1.59 kB (new file) 🆕
packages/frontend/dist/assets/TrackHistory-CZptVL-w.js 2.31 kB +2.31 kB (new file) 🆕
packages/frontend/dist/assets/TrackHistory-DbBr-C-O.js 0 B -2.31 kB (removed) 🏆
packages/frontend/dist/assets/TwitchNotifications-B8z-_9OL.js 0 B -2.43 kB (removed) 🏆
packages/frontend/dist/assets/TwitchNotifications-Dnxe-Gzz.js 2.43 kB +2.43 kB (new file) 🆕
packages/frontend/dist/assets/useActiveHeading-Bb26cyRV.js 0 B -1.36 kB (removed) 🏆
packages/frontend/dist/assets/useActiveHeading-DNZzF8Yn.js 1.36 kB +1.36 kB (new file) 🆕
packages/frontend/dist/assets/useFeatures-4FGlgk8d.js 0 B -2.06 kB (removed) 🏆
packages/frontend/dist/assets/useFeatures-BXcS46pP.js 2.06 kB +2.06 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
packages/frontend/dist/assets/index-DhrBWMdh.css 18.1 kB
packages/frontend/dist/assets/legalNav-B6k3CWsW.js 274 B
packages/frontend/dist/assets/rolldown-runtime-Cyuzqnbw.js 471 B
packages/frontend/dist/assets/routeMeta-BZjtwMbs.js 595 B
packages/frontend/dist/assets/sentry-DhXOA89y.js 3.76 kB
packages/frontend/dist/assets/usePageMetadata-DTv-6eVb.js 327 B
packages/frontend/dist/assets/vendor-forms-C-bof8GF.js 25.9 kB
packages/frontend/dist/assets/vendor-radix-qkfmDH9H.js 39.9 kB
packages/frontend/dist/assets/vendor-react-B7C34xnu.js 55.7 kB
packages/frontend/dist/assets/vendor-state-Dw4-MN6C.js 24.2 kB
packages/frontend/dist/assets/vendor-ui-B-NOqBBC.js 66 kB

compressed-size-action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/backend/tests/unit/middleware/session.test.ts (1)

110-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restore NODE_ENV in a finally block.

If either assertion fails, these tests leave process.env.NODE_ENV overridden and can skew the rest of the suite. Wrap the env mutation in try/finally so cleanup always runs.

Also applies to: 131-144

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/backend/tests/unit/middleware/session.test.ts` around lines 110 -
125, The session middleware tests mutate process.env.NODE_ENV without guaranteed
cleanup, which can leak state into later tests. Update the affected cases in
session.test.ts around setupSessionMiddleware and the source assertion to wrap
the NODE_ENV override in a try/finally so the original value is always restored,
even if an expectation fails. Use the existing originalEnv variable and keep the
cleanup local to each test block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@decisions/2026-06-27-standardize-test-runner-vitest.md`:
- Around line 28-30: Tighten the SonarCloud rationale in the decision note so it
does not imply Jest lacks native lcov output or depends on a separate Sonar
plugin. Reword the Sonar section to acknowledge the current Jest config already
emits lcov, and keep the emphasis on standardizing on Vitest for consistent
tooling and coverage format across packages; update the wording in the
SonarCloud consistency bullet in the decision document.

In `@packages/backend/tests/unit/middleware/session.test.ts`:
- Around line 119-123: The session middleware tests are asserting the source
text of session.ts instead of the behavior of setupSessionMiddleware(). Update
the relevant cases in session.test.ts to invoke setupSessionMiddleware() and
capture the options passed to express-session, then assert cookie.sameSite and
cookie.secure directly for each environment. Use the setupSessionMiddleware
symbol and the express-session mock/spy in the test to verify the middleware
options rather than grepping for ternary strings.

---

Nitpick comments:
In `@packages/backend/tests/unit/middleware/session.test.ts`:
- Around line 110-125: The session middleware tests mutate process.env.NODE_ENV
without guaranteed cleanup, which can leak state into later tests. Update the
affected cases in session.test.ts around setupSessionMiddleware and the source
assertion to wrap the NODE_ENV override in a try/finally so the original value
is always restored, even if an expectation fails. Use the existing originalEnv
variable and keep the cleanup local to each test block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5a65b113-8bad-43c8-9eed-b939dc4bdec9

📥 Commits

Reviewing files that changed from the base of the PR and between c7801f1 and e67503c.

📒 Files selected for processing (5)
  • decisions/2026-06-27-eslint-legacy-config-cleanup.md
  • decisions/2026-06-27-standardize-test-runner-vitest.md
  • packages/backend/src/middleware/session.ts
  • packages/backend/tests/unit/middleware/session.test.ts
  • packages/frontend/src/services/api.ts

Comment thread decisions/2026-06-27-standardize-test-runner-vitest.md
Comment thread packages/backend/tests/unit/middleware/session.test.ts
The production session middleware now uses sameSite:'none' (was 'lax')
so the tests asserting SameSite=Lax in production scenarios were failing.
Updated both locations to expect SameSite=None to match the middleware.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/backend/tests/integration/routes/auth.test.ts (1)

131-159: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Trust the proxy before asserting on the forwarded HTTPS cookie. This express() instance never enables trust proxy, so x-forwarded-proto: https won’t exercise the same Secure cookie path as production. Add localApp.set('trust proxy', 1) here or build the app the same way as the production bootstrap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/backend/tests/integration/routes/auth.test.ts` around lines 131 -
159, The secure-session test for forwarded HTTPS is using a bare express app
without proxy trust, so it is not exercising the same cookie path as production.
Update the local app setup in the auth integration test to enable proxy trust
before calling setupSessionMiddleware and setupAuthRoutes, or otherwise
construct it through the same bootstrap path used in production so
x-forwarded-proto is respected when asserting the Secure and SameSite=None
session cookie behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/backend/tests/integration/routes/auth.test.ts`:
- Around line 131-159: The secure-session test for forwarded HTTPS is using a
bare express app without proxy trust, so it is not exercising the same cookie
path as production. Update the local app setup in the auth integration test to
enable proxy trust before calling setupSessionMiddleware and setupAuthRoutes, or
otherwise construct it through the same bootstrap path used in production so
x-forwarded-proto is respected when asserting the Secure and SameSite=None
session cookie behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 87ff9674-1ba0-4bae-ad5b-73c7e57c5af6

📥 Commits

Reviewing files that changed from the base of the PR and between e67503c and d854644.

📒 Files selected for processing (1)
  • packages/backend/tests/integration/routes/auth.test.ts

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 572e320 into main Jun 28, 2026
43 of 44 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/auth-loop-hotfix branch June 28, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant