MovixOpenSource/API/Mainapi/package.json
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

54 lines
1.4 KiB
JSON

{
"name": "movix-api",
"private": true,
"type": "commonjs",
"scripts": {
"start": "node server.js",
"dev": "node server.js",
"start-new": "node server-new.js"
},
"dependencies": {
"@fastify/compress": "^8.3.1",
"@fastify/cookie": "^11.0.2",
"@fastify/cors": "^11.2.0",
"@fastify/express": "^4.0.2",
"@fastify/formbody": "^8.0.2",
"@fastify/middie": "^9.1.0",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"axios": "^1.11.0",
"axios-cookiejar-support": "^6.0.4",
"better-sqlite3": "^12.5.0",
"bip32": "^5.0.1",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^7.0.1",
"chardet": "^2.0.0",
"cheerio": "^1.1.2",
"compression": "^1.8.1",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"crypto-js": "^4.2.0",
"cycletls": "^1.0.27",
"dotenv": "^17.2.1",
"express": "^4.21.2",
"express-list-endpoints": "^7.1.1",
"express-rate-limit": "^8.2.1",
"fastify": "^5.6.2",
"got-scraping": "^4.1.3",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.6",
"impit": "^0.9.2",
"ioredis": "^5.9.2",
"jsonwebtoken": "^9.0.2",
"mysql2": "^3.15.0",
"openai": "^6.15.0",
"proper-lockfile": "^4.1.2",
"socket.io": "^4.8.3",
"socks-proxy-agent": "^8.0.5",
"sqlite3": "^5.1.7",
"tiny-secp256k1": "^2.2.4",
"tough-cookie": "^5.1.2",
"uuid": "^11.1.0",
"web-push": "^3.6.7",
"write-file-atomic": "^6.0.0"
}
}