Met a jour lastConnectionAt sur /api/me
This commit is contained in:
Vendored
+11
-1
@@ -626,7 +626,17 @@ function registerAuthApiRoutes(options) {
|
||||
return res.status(200).json({ ok: true });
|
||||
});
|
||||
options.app.get(mePath, options.requireSession, async (req, res) => {
|
||||
res.json({ user: req.authUser });
|
||||
const authUser = req.authUser;
|
||||
if (typeof authUser?.id === "string") {
|
||||
try {
|
||||
await options.prisma.user.update({
|
||||
where: { id: authUser.id },
|
||||
data: { lastConnectionAt: /* @__PURE__ */ new Date() }
|
||||
});
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
res.json({ user: authUser });
|
||||
});
|
||||
}
|
||||
export {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user