wealth/docs/decisions/0027-feed-at-feed-landing-r...

20 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

# 0027 خانه lives at /feed; the landing sends signed-in people on in the browser
Status: Accepted · Area: architecture · Date: 2026-10-07 · Decided by: user · Supersedes: 0024
## Context
The design moved the investor's feed from `/` to `/feed` when `/` became the guest landing, and asks for signed-in visitors to be redirected in middleware from the session cookie. The server render never depends on auth here, and the Next.js proxy was removed for that reason.
## Decision
- خانه, the investor's feed, is `/feed` (`ROUTES.home`); the landing is `/` (`ROUTES.landing`). The feed keeps 0024's rules: read only in the browser behind a same-size skeleton, `HomeGuard` sends a guest to login and a creator to their channel.
- On `/`, `LandingRedirect` waits for the browser's session and then `router.replace`s a member to `homeRoute`: step 5 while `needsProfile`, a creator's own channel, or `/feed`. Guests and expired sessions stay. No proxy, no cookie read on the server.
- A guest's brand link (top bars, desktop header, auth frames) goes to `/`.
## Alternatives
- Proxy (`proxy.ts`) redirect on the session cookie, as the design asks: rejected by the user; it brings back the proxy, can't tell a creator from an investor, and misses sessions whose 15-minute access cookie expired.
## Consequences
- A signed-in person who opens `/` sees the landing briefly before the redirect.
- «بازگشت به خانه» buttons still lead to `/feed`, so a guest there lands on login.
- After «خروج», the account page (not built yet) should send the person to `/`.