Skip to content

move auth guard to layout + convert pages to server components,cleanup#673

Merged
moehdotdev merged 1 commit into
mainfrom
dev
Apr 14, 2026
Merged

move auth guard to layout + convert pages to server components,cleanup#673
moehdotdev merged 1 commit into
mainfrom
dev

Conversation

@moehdotdev

Copy link
Copy Markdown
Member

solid architectural improvement auth checks moved out of individual client pages and into the layout where they belong.

what changed

app/home/layout.tsx server-side auth guard
added isAuthenticatedNextjs() check at the layout level. any unauthenticated request to any /home/* route now redirects to /signup before rendering anything. this replaces the per-page client-side useConvexAuth + useEffect + router.replace pattern.

app/home/page.tsx, app/home/[id]/page.tsx, app/home/[id]/[slug]/page.tsx
all three converted from client components to server components. removed useConvexAuth, useRouter, useEffect, and useMemo from each. they now just read params server-side and pass them down to the existing client components.

app/home/[id]/[slug]/loading.tsx + NoteLoadingSkeletonUI.tsx
both updated to use w-[900px] to match the note page content width. NoteLoadingSkeletonUI was also rewritten with a proper Skeleton + ParagraphSkeleton component structure instead of the old flat div approach.

app/privacy-policy/page.tsx + app/terms-of-service/page.tsx
removed the sticky footer pill from both pages it had unused imports, relied on a scrolled state not shown in context, and was dead ui.

why

the old pattern had a flash of null while waiting for auth to resolve on the client. the layout-level server check is instant and cleaner. also makes the page files much smaller.

now

  • no auth flash on protected pages
  • home pages are now proper server components
  • loading skeleton matches actual content width
  • legal pages are simpler with dead ui removed

@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
notevo Building Building Preview, Comment Apr 14, 2026 10:49pm

@moehdotdev moehdotdev merged commit b183672 into main Apr 14, 2026
1 of 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.

1 participant