Skip to content

Davidasix/protected pages are protected#9

Merged
DavidASix merged 8 commits into
mainfrom
davidasix/protected-pages-are-protected
Jun 29, 2025
Merged

Davidasix/protected pages are protected#9
DavidASix merged 8 commits into
mainfrom
davidasix/protected-pages-are-protected

Conversation

@DavidASix

Copy link
Copy Markdown
Owner

Shuffled around some logic to ensure that protected routes are protected and not protected routes are not. Also simplified the routing implementation

@DavidASix
DavidASix requested a review from Copilot June 29, 2025 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors routing logic to ensure that protected pages are accessible only to authenticated users while public pages remain open, and it simplifies the routing implementation.

  • Introduces a new QueryProvider for handling React Query configuration and error reporting.
  • Removes the standalone page.tsx and adjusts site and product layouts to enforce route protection.
  • Moves authentication checks into layout components, redirecting users as appropriate.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/tan-stack/query-provider.tsx Adds a QueryProvider wrapper with error handling via toast.
src/app/page.tsx Removes the redundant landing page with authentication logic.
src/app/(site)/page.tsx Replaces explicit SiteLayout wrapper with a fragment to avoid duplicate layout rendering.
src/app/(site)/layout.tsx Moves authentication check to the layout, redirecting authenticated users to the dashboard.
src/app/(product)/layout.tsx Replaces client-side QueryClient logic with the new QueryProvider and adds a guard to redirect unauthenticated users to login.

Comment thread src/app/(site)/layout.tsx Outdated
Comment thread src/app/(product)/layout.tsx Outdated
@DavidASix DavidASix linked an issue Jun 29, 2025 that may be closed by this pull request
@DavidASix
DavidASix merged commit 4d3eb34 into main Jun 29, 2025
2 checks passed
@DavidASix
DavidASix deleted the davidasix/protected-pages-are-protected branch July 27, 2025 21:17
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.

"Protected" pages are currently accessible

2 participants