Skip to content

Commit

Permalink
server: link account and environment to authenticated trace (NangoHQ#…
Browse files Browse the repository at this point in the history
  • Loading branch information
TBonnin authored Jan 25, 2024
1 parent a28f676 commit cf4819f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/server/lib/controllers/access.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
errorManager,
userService
} from '@nangohq/shared';
import tracer from '../apm.js';

export class AccessMiddleware {
async secretKeyAuth(req: Request, res: Response, next: NextFunction) {
Expand Down Expand Up @@ -45,6 +46,7 @@ export class AccessMiddleware {

setAccount(accountId, res);
setEnvironmentId(environmentId, res);
tracer.setUser({ id: accountId.toString(), environmentId: environmentId.toString() });
next();
}

Expand Down Expand Up @@ -76,6 +78,7 @@ export class AccessMiddleware {

setAccount(accountId, res);
setEnvironmentId(environmentId, res);
tracer.setUser({ id: accountId.toString(), environmentId: environmentId.toString() });
next();
}

Expand Down

0 comments on commit cf4819f

Please sign in to comment.