fix: resolve backend docker build errors
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user