chore: post-2.0 QA hygiene across api hardening and qa metadata

This commit is contained in:
SnapOtter
2026-06-20 10:50:20 +08:00
parent 19d9ed181a
commit 0acc8ca751
11 changed files with 332 additions and 57 deletions
+13
View File
@@ -413,6 +413,19 @@ export async function authRoutes(app: FastifyInstance): Promise<void> {
// MFA plugin not loaded
}
const cookieReply = reply as FastifyReply & {
setCookie?: (name: string, value: string, opts: Record<string, unknown>) => FastifyReply;
};
if (typeof cookieReply.setCookie === "function") {
cookieReply.setCookie("snapotter-session", token, {
path: "/",
httpOnly: true,
sameSite: "strict",
secure: env.EXTERNAL_URL.startsWith("https"),
maxAge: SESSION_DURATION_MS / 1000,
});
}
return reply.send({
token,
user: {