You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ These instructions apply to the whole repository.
17
17
## Auth, Sessions, and Public-Page Performance
18
18
19
19
-`src/proxy.ts` intentionally does not refresh Supabase auth on every request. Public pages should use `createSignedOutResponse()` so their initial response does not wait on `supabase.auth.getUser()`.
20
-
- Only add paths to `authRequiredPathPrefixes` when the first server response must know auth state, such as protected routes, auth callbacks, and guest-only auth pages. Adding public routes there can regress TTFB, FCP, and LCP.
20
+
- Only add paths to `authRequiredPathPrefixes` when the first server response must know auth state, such as protected routes, auth callbacks, guest-only auth pages, or routes that server-render private/public data differently. `/map` and `/listings` belong there because they call server `auth.getUser()` before choosing listing data sources.
21
21
- Server components that branch on auth should treat `authStateHeaderName` as a forwarded proxy hint, not proof that public routes have performed a fresh auth lookup. Public pages are deliberately signed-out on the initial server render until client auth resolves.
22
22
- Keep auth-aware public UI in small client slots or enhancements, such as `AccountButton`, `FooterLocaleSlot`, and unread chat dots. It is acceptable for these to appear or update after first paint.
23
23
- Keep `UnreadMessagesProvider` scoped to tab-bar and chat layouts rather than the root layout. It should not make public HTML wait on Supabase, and its initial auth/unread check should remain idle or otherwise deferred.
Copy file name to clipboardExpand all lines: docs/auth-session-architecture.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ Peels keeps public pages fast by avoiding a server-side Supabase auth refresh un
8
8
9
9
- Auth-required paths use `updateSession()`. This creates a Supabase server client, calls `supabase.auth.getUser()`, refreshes cookies when needed, forwards `x-peels-auth-state`, and applies auth redirects for protected or guest-only pages.
10
10
- Public paths use `createSignedOutResponse()`. This forwards the current path and a signed-out auth hint without calling Supabase, so pages such as `/`, `/share`, and static content do not block first paint on auth.
11
-
-`authRequiredPathPrefixes` should stay small. Add to it only when the first server response truly needs auth state.
11
+
-`authRequiredPathPrefixes` should stay small. Add to it only when the first server response truly needs auth state.`/map` and `/listings` belong there because they server-render auth-aware listing data before client hydration.
12
12
13
-
The forwarded auth state is a rendering hint. On public routes, it intentionally says signed-out on the initial server render even if the browser has a valid session cookie. Client-side auth slots can then resolve the real state after hydration.
13
+
The forwarded auth state is a rendering hint. On public routes that do not need server auth, it intentionally says signed-out on the initial server render even if the browser has a valid session cookie. Client-side auth slots can then resolve the real state after hydration.
14
14
15
15
## Locale Behaviour
16
16
@@ -38,7 +38,7 @@ The unread check should stay deferred so it does not delay public HTML. If the u
38
38
39
39
The homepage should server-render useful static content first, then hydrate dynamism later.
40
40
41
-
-`IntroHeader`owns the static hero frame and primary calls to action.
41
+
-`IntroHeader`reserves the hero visual space without server-rendering the decorative map/avatar/pin frame.
42
42
-`DeferredIntroHeaderRotator` loads the animated hero rotator after the first paint/idle window.
43
43
-`PeelsHowItWorks` keeps crawlable explanatory content in the initial HTML.
44
44
- Deferred demo components load map, listing, chat, and photo demos after intersection or idle.
0 commit comments