Fix auth flows and add daemon heartbeat endpoint
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user