Fix auth flows and add daemon heartbeat endpoint

This commit is contained in:
2026-02-22 09:41:17 +00:00
parent c926613ee0
commit d7d8fd5339
8 changed files with 115 additions and 11 deletions
+2 -3
View File
@@ -6,7 +6,6 @@ import type { AccessTokenPayload } from '../lib/jwt.js';
declare module 'fastify' {
interface FastifyInstance {
authenticate: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
jwtRefresh: FastifyInstance['jwt'];
}
}
@@ -28,13 +27,13 @@ export default fp(async (app: FastifyInstance) => {
// Access token JWT
await app.register(jwt, {
secret: jwtSecret,
namespace: 'jwt',
});
// Refresh token JWT (separate namespace)
await app.register(jwt, {
secret: jwtRefreshSecret,
namespace: 'jwtRefresh',
namespace: 'refresh',
decoratorName: 'jwtRefresh',
});
// Auth decorator