Skip to content

Commit b0b0106

Browse files
committed
♻️ Rename platypusUserId to userId
1 parent 56afcb0 commit b0b0106

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/middlewares/extract-header.middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AsyncLocalStorage } from 'async_hooks';
44

55
const DEFAULT_LOCALE = 'de-DE';
66

7-
export const playtypusUserIdStorage = new AsyncLocalStorage<string>();
7+
export const userIdStorage = new AsyncLocalStorage<string>();
88

99
export function extractHeaderMiddleware(
1010
req: BridgeRequest<any>,
@@ -23,5 +23,5 @@ export function extractHeaderMiddleware(
2323
locale,
2424
};
2525

26-
playtypusUserIdStorage.run(userId, () => next());
26+
userIdStorage.run(userId, () => next());
2727
}

src/util/logger.util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { context, trace } from '@opentelemetry/api';
22

33
import { anonymizeKey } from './anonymize-key';
4-
import { playtypusUserIdStorage } from '../middlewares';
4+
import { userIdStorage } from '../middlewares';
55

66
function addMessageToTraceSpan(
77
method: 'log' | 'error' | 'warn',
@@ -85,10 +85,10 @@ const logger = (
8585
}
8686

8787
const data: Record<string, unknown> = { ...args };
88-
const userId = playtypusUserIdStorage.getStore();
88+
const userId = userIdStorage.getStore();
8989

9090
if (userId) {
91-
data.platypusUserId = userId;
91+
data.userId = userId;
9292
}
9393

9494
const anonymizedApiKey = apiKey ? anonymizeKey(apiKey) : undefined;

0 commit comments

Comments
 (0)