Skip to content

Commit

Permalink
feat: set user in Sentry for API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
agrattan0820 committed Sep 22, 2023
1 parent 2214fb3 commit f599ef8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f599ef8

Please sign in to comment.