fix(navbar): /me/ai-usage showed the visitor navbar while authenticated (#71)#72
Merged
trentas merged 1 commit intoJun 3, 2026
Conversation
|
Atlantis commands can't be run on fork pull requests. To enable, set --allow-fork-prs or, to disable this message, set --silence-fork-pr-errors |
|
|
@gabriel-vieira-clickbus is attempting to deploy a commit to the Clickbus Team on Vercel. A member of the Team first needs to authorize it. |
…ed (RocketBus#71) /me/* is authenticated but lives outside /[tenant], so it never got the tenant layout. ConditionalNavbar treated /me/ as a public prefix, so the root layout rendered the visitor navbar (Entrar/Começar) on a logged-in page even though the body still showed personal metrics. - Add src/app/me/layout.tsx: authenticated chrome (session guard + TenantProvider + TenantNavbar) scoped to the user's primary org. - Drop /me/ from ConditionalNavbar PUBLIC_PREFIXES so the visitor navbar no longer renders there. - Move page padding into the layout (p-4 sm:p-6), matching how [tenant]/layout.tsx owns padding; drop the floating-navbar offset. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
83ec3ac to
95b2377
Compare
|
Atlantis commands can't be run on fork pull requests. To enable, set --allow-fork-prs or, to disable this message, set --silence-fork-pr-errors |
|
trentas
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #71
Problem
After signing in, navigating to
/me/ai-usagerendered the public/visitor navbar (Deck/FAQ, language toggle, Entrar / Começar) — making the page look logged out — even though the page body still rendered the user's personal AI-usage metrics. The session was never actually lost; only the header was wrong.Root cause
/me/*is authenticated but lives outsidesrc/app/[tenant]/, so it never inherits the tenant layout (which is what mounts the authenticatedTenantNavbar). On top of that,ConditionalNavbartreated/me/as a public prefix, so the root layout actively rendered the visitorNavbarthere. Net result: authenticated content under a visitor header.Changes
src/app/me/layout.tsx(new) — authenticated chrome for/me/*, mirroring[tenant]/layout.tsx:getServerSessionguard (redirect to signin when unauthenticated) +TenantProvider+TenantNavbar, scoped to the user's primary org for the navbar links/org switcher. The layout owns the page padding (p-4 sm:p-6), consistent with how[tenant]/layout.tsxdoes it.src/components/ConditionalNavbar.tsx— remove/me/fromPUBLIC_PREFIXESso the visitor navbar no longer renders on a logged-in page (with a comment so it isn't "helpfully" re-added).src/app/me/ai-usage/page.tsx— drop the per-page padding that was sized for the floating visitor navbar (py-28 lg:pt-44); padding now comes from the layout.Validation (local)
GET /me/ai-usage→307to/auth/signin?callbackUrl=/me/ai-usage.GET /me/ai-usage→200; rendered HTML contains the authenticatedTenantNavbarshell (border-b bg-background/95) and zero occurrences of the visitor pill navbar (rounded-4xl). Before the fix this was inverted.npx tsc --noEmitclean on the changed files; pre-commiteslint --fix+prettierapplied.Notes
GET /api/auth/*(csrf/session) to return500under password auth (NextAuth v4 + Next 16). It does not affect this fix or production (which uses GitHub OAuth), but it limits client-sideuseSession()hydration locally — worth a separate[BUG].🤖 Generated with Claude Code