fix: resolve backend docker build errors

This commit is contained in:
Vaka.pro
2026-04-26 19:06:50 +03:00
parent 4f4f9ff998
commit c49abafc61
4 changed files with 3660 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
import fp from 'fastify-plugin';
import fastifyJwt from '@fastify/jwt';
import fastifyCookie from '@fastify/cookie';
import type { FastifyReply } from 'fastify';
import { env } from '../config/env.js';
import { UnauthorizedError } from '../utils/errors.js';
@@ -28,7 +29,7 @@ export default fp(async (app) => {
});
// helpers for routes
app.decorate('setAuthCookie', ((reply, token) => {
app.decorate('setAuthCookie', ((reply: FastifyReply, token: string) => {
reply.setCookie(AUTH_COOKIE, token, {
httpOnly: true,
secure: env.NODE_ENV === 'production',
@@ -38,7 +39,7 @@ export default fp(async (app) => {
});
}) as never);
app.decorate('clearAuthCookie', ((reply) => {
app.decorate('clearAuthCookie', ((reply: FastifyReply) => {
reply.clearCookie(AUTH_COOKIE, { path: '/' });
}) as never);
});