fix:deploy

This commit is contained in:
2026-03-10 02:31:21 +09:00
parent b1c45b9e8a
commit 0334fb43c9
3 changed files with 48 additions and 13 deletions

View File

@@ -17,8 +17,7 @@ const sessionSecret = process.env.SESSION_SECRET;
if (!sessionSecret) throw new Error("SESSION_SECRET env var is required");
const app = Fastify({
// In prod: warn-level only to reduce noise; in dev: full pretty logging
logger: isProd ? { level: "warn" } : true,
logger: isProd ? { level: "info" } : true,
// Trust the nginx reverse proxy so secure cookies and req.ip work correctly
trustProxy: isProd,
});

View File

@@ -80,7 +80,8 @@ export const authRouter: FastifyPluginAsync = async (fastify) => {
req.session.user = user;
const base = process.env.FRONTEND_APP_URL ?? "http://localhost:5173";
reply.redirect(`${base}?login=1`);
const baseUrl = base.endsWith("/") ? base : `${base}/`;
reply.redirect(`${baseUrl}?login=1`);
},
);