Skip to content

fix: redirect unauthenticated users from subscriptions page#4137

Open
FaisalMisbah23 wants to merge 1 commit into
Kilo-Org:mainfrom
FaisalMisbah23:fix/subscriptions-auth-redirect
Open

fix: redirect unauthenticated users from subscriptions page#4137
FaisalMisbah23 wants to merge 1 commit into
Kilo-Org:mainfrom
FaisalMisbah23:fix/subscriptions-auth-redirect

Conversation

@FaisalMisbah23

Copy link
Copy Markdown

Summary

Fix unauthenticated access handling for the subscriptions page.

Previously, a logged-out user could navigate directly to /subscriptions. The page would render and then display an authentication error after a subscription-related API request returned 401.

This change adds an authentication check at the subscriptions layout level using getUserFromAuthOrRedirect(), ensuring unauthenticated users are redirected before subscription content is rendered.

Fixes #4136

Verification

  • Logged out and attempted to access /subscriptions
  • Confirmed unauthenticated users are redirected instead of seeing the authentication error
  • Added test coverage for the subscriptions layout authentication requirement

Visual Changes

N/A

Reviewer Notes

This change applies the authentication guard at the layout level so all routes under /subscriptions require authentication before rendering.

@kilo-code-bot

kilo-code-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/app/(app)/subscriptions/layout.tsx
  • apps/web/src/app/(app)/subscriptions/layout.test.tsx

Reviewed by gpt-5.4-20260305 · Input: 63K · Output: 5.8K · Cached: 322K

Review guidance: REVIEW.md from base branch main

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.

Unauthenticated users can access /subscriptions and see raw authentication error

1 participant