From f599ef8777d25f486721d992537648b5a9a5c504 Mon Sep 17 00:00:00 2001 From: GameDog9988 Date: Thu, 21 Sep 2023 21:14:38 -0400 Subject: [PATCH] feat: set user in Sentry for API calls --- apps/server/src/server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts index d4f8d7f7..413e482b 100644 --- a/apps/server/src/server.ts +++ b/apps/server/src/server.ts @@ -115,12 +115,16 @@ export function buildServer() { return; } - await redis.set(sessionToken, checkDBForSession.expires.toISOString()); + Sentry.setUser({ id: checkDBForSession.userId }); + + await redis.set(sessionToken, checkDBForSession.userId); await redis.expireat( sessionToken, Math.floor(checkDBForSession.expires.getTime() / 1000) ); + } else { + Sentry.setUser({ id: redisSession }); } next();