KI-AGENT: Refresh-Token für Web-Sitzungen ergänzen
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user