Revert "fix: add server-side auth gate to tenant layout"#1980
Revert "fix: add server-side auth gate to tenant layout"#1980amikofalvy merged 1 commit intomainfrom
Conversation
This reverts commit a9f06e4.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
There was a problem hiding this comment.
PR Review Summary
(1) Total Issues | Risk: Medium
🟠⚠️ Major (1) 🟠⚠️
🟠 1) system Missing rationale for revert with observable UX regression
Issue: This PR reverts PR #1976 without explaining why the revert is needed. The original PR added server-side auth enforcement that redirected unauthenticated users to /login before rendering tenant-scoped content. Without this gate, unauthenticated users will now:
- Receive and render the full tenant layout shell (sidebar, header, breadcrumbs)
- See a brief "flash of unauthorized content" before client-side auth handlers trigger a redirect
- Experience a degraded UX compared to the immediate server-side redirect
Why: The security model remains intact (API-level auth prevents data access), but this creates a noticeable UX regression. The PR description simply says "Reverts #1976" without explaining:
- What issue the original PR caused that necessitated a revert
- Whether this is a temporary rollback while investigating, or a permanent architectural decision
- Whether an alternative approach (e.g., Next.js middleware) will be implemented
Fix: Add context to the PR description or a comment explaining:
- The reason for the revert (build failure? runtime issue? performance concern?)
- Whether this is temporary or permanent
- If permanent, consider documenting the intended auth architecture and accepted tradeoff
Refs:
💭 Consider (1) 💭
💭 1) multi-file Inlined cookie prefix string creates minor duplication
Issue: The centralized constants.ts file is deleted, and the 'better-auth' cookie prefix is now inlined in 3 locations within agents-manage-ui.
Why: This creates minor divergence risk if cookie names change, though the prefix is defined by the better-auth library and unlikely to change. The duplication is manageable.
Fix: If the revert is permanent, consider whether a minimal constant (BETTER_AUTH_COOKIE_PREFIX = 'better-auth') should be retained for maintainability. If temporary, no action needed.
Refs:
💡 APPROVE WITH SUGGESTIONS
Summary: The code changes are technically correct and the security model remains intact (API-level auth prevents unauthorized data access). However, this revert removes a UX improvement without explaining why. Please consider adding context about the reason for reverting PR #1976 so reviewers and future maintainers understand the tradeoff being made.
Discarded (3)
| Location | Issue | Reason Discarded |
|---|---|---|
layout.tsx |
Layout component pattern is valid after conversion | Informational/positive observation, not an actionable issue |
layout.tsx |
Accessibility patterns (semantic HTML, ARIA labels) maintained | Informational/positive observation, not an actionable issue |
system |
Security vulnerability from removed auth gate | Security reviewer confirmed API-level auth is the primary control; this is UX, not security |
Reviewers (5)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-product |
2 | 1 | 0 | 0 | 0 | 0 | 0 |
pr-review-consistency |
1 | 0 | 1 | 0 | 0 | 0 | 0 |
pr-review-frontend |
3 | 0 | 0 | 0 | 0 | 0 | 2 |
pr-review-security-iam |
0 | 0 | 0 | 0 | 0 | 0 | 1 |
pr-review-standards |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 6 | 1 | 1 | 0 | 0 | 0 | 3 |
Note: Security reviewer's thorough analysis confirmed the API-level authentication remains the primary security control, correctly reclassifying the concern as UX rather than security.
Reverts #1976