fix:deploy
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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`);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user