KI-AGENT: Refresh-Token für Web-Sitzungen ergänzen

This commit is contained in:
2026-07-20 22:12:09 +02:00
parent 657a4f9e85
commit 5585bd7012
3 changed files with 104 additions and 37 deletions

View File

@@ -65,11 +65,12 @@ export default async function authRoutes(server: FastifyInstance) {
properties: {
email: { type: "string", format: "email" },
password: { type: "string" },
rememberMe: { type: "boolean" },
},
},
},
}, async (req, reply) => {
const body = req.body as { email: string; password: string };
const body = req.body as { email: string; password: string; rememberMe?: boolean };
let user: any = null;
@@ -135,7 +136,7 @@ export default async function authRoutes(server: FastifyInstance) {
httpOnly: true,
sameSite: process.env.NODE_ENV === "production" ? "none" : "lax",
secure: process.env.NODE_ENV === "production",
maxAge: 60 * 60 * 6,
...(body.rememberMe ? { maxAge: 60 * 60 * 6 } : {}),
});
return { token, refreshToken };