MovixOpenSource/API/Mainapi/middleware
Satanas1275 487a6e1481 fix: remove OAuth tokens from localStorage, add HttpOnly cookie auth
- Stop storing discord_token and google_token in localStorage (XSS risk)
  These tokens are never read, only written; backend already stores them
  server-side in user data files.
- Remove discord_token and google_token from AUTH_KEYS array
- Add cookie-parser middleware to Express app
- Add setAuthCookie() helper to set JWT as HttpOnly; Secure; SameSite=Lax cookie
- Update auth routes (BIP39 register/login, Discord, Google) to set cookie
- Update getAuthIfValid() to read JWT from cookie first, then Authorization header
- Add extractJwtFromRequest() helper for dual-mode auth (cookie + header)
- Add GET /api/auth/session endpoint to rehydrate JWT from cookie on page reload
2026-07-02 00:13:41 +02:00
..
auth.js fix: remove OAuth tokens from localStorage, add HttpOnly cookie auth 2026-07-02 00:13:41 +02:00
cors.js Nouvelle adresse movix + nouvelles fonctionalités 2026-05-14 17:26:13 +02:00
security.js Nouvelle adresse movix + nouvelles fonctionalités 2026-05-14 17:26:13 +02:00