Skip to content

Commit a20d29c

Browse files
committed
logger cds data compat changes
1 parent 56e34c4 commit a20d29c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/shared/logger.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,15 @@ class Logger {
171171
}
172172

173173
const cdsContext = cds?.context;
174-
const req = cdsContext?.http?.req;
175174
const cdsData = cdsContext
176175
? {
177176
[FIELD.CORRELATION_ID]: cdsContext.id,
178177
[FIELD.REMOTE_USER]: cdsContext.user?.id,
179178
[FIELD.TENANT_ID]: cdsContext.tenant,
180-
[FIELD.TENANT_SUBDOMAIN]: req?.authInfo?.getSubdomain?.(),
179+
[FIELD.TENANT_SUBDOMAIN]:
180+
cdsContext.user?.authInfo?.getSubdomain?.() ??
181+
cdsContext.user?.tokenInfo?.getSubdomain?.() ??
182+
cdsContext?.http?.req?.authInfo?.getSubdomain?.(),
181183
}
182184
: undefined;
183185
// NOTE: the start time of Date's milliseconds is the epoch and the start time for hrtime is an arbitrary time

0 commit comments

Comments
 (0)