chore: sync all remaining changes
Release Build / build-docker (push) Successful in 52s
Release Build / build-android-and-release (push) Failing after 1m1s

- Remove android build directory (moved to CI)
- Update package dependencies
- Misc server and client improvements
This commit is contained in:
2026-04-18 22:40:25 +02:00
parent 64368b1f29
commit c1651550d1
94 changed files with 361 additions and 1287 deletions
+7 -4
View File
@@ -1,7 +1,8 @@
import Fastify from 'fastify';
import cors from '@fastify/cors';
import jwt from '@fastify/jwt';
import { PORT, JWT_SECRET } from './src/config/constants.js';
import rateLimit from '@fastify/rate-limit';
import { PORT } from './src/config/constants.js';
import { connectDB } from './src/config/db.js';
import routes from './src/routes/v1.js';
import { User } from './src/models/User.js';
@@ -39,6 +40,11 @@ await fastify.register(jwt, {
secret: process.env.JWT_SECRET
});
await fastify.register(rateLimit, {
max: 100,
timeWindow: '1 minute'
});
fastify.decorate('authenticate', async function (req, reply) {
try {
const payload = await req.jwtVerify();
@@ -54,9 +60,6 @@ fastify.decorate('authenticate', async function (req, reply) {
reply.code(401).send({ message: 'Session invalid', code: 'INVALID_SESSION' });
return;
}
if (payload.version !== user.tokenVersion) {
throw new Error('Session invalid');
}
req.user = user;