wealth/platforms/market
Amiram_se aafac927bf refactor(market,apps): drop the session proxy and restore auth in the browser
The server render no longer depends on auth: it reads no session and
forwards only FORWARDED_COOKIES (none today), so every visitor of a URL
gets the same HTML and the Next.js proxy is no longer needed.

- Remove proxy.ts from bull and bear, the app/session module, the
  server auth and role guards, and the server caches that read the
  viewer's own data. Public caches stay: channel, post, prediction stats.
- Add an auth store (status unknown | guest | member) filled by the
  restoreSession action, which reads GET /auth/session once per load
  from the AppShell's useSession hook.
- Login and register actions set the store, logout clears it; the
  AppShell clears the query cache on auth.logout. No router.refresh.
- Add client AuthGuard (fallback, optional role) and GuestGuard, with
  safeReturnPath limiting post-login redirects to same-site paths.
- readOnServer no longer redirects on 401.
- The browser HTTP client refreshes against AUTH_ENDPOINTS.refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 22:28:05 +04:00
..
src refactor(market,apps): drop the session proxy and restore auth in the browser 2026-10-04 22:28:05 +04:00
.babelrc
…
eslint.config.mjs
…
package.json feat(market): app foundation, session handling and feature data layer 2026-10-04 21:33:07 +04:00
tsconfig.json
…
tsconfig.lib.json feat(market): app foundation, session handling and feature data layer 2026-10-04 21:33:07 +04:00