1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

Merge branch 'master' into trace-automations

This commit is contained in:
Sam Rose 2023-12-19 17:14:17 +00:00 committed by GitHub
commit e4512c8004
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ export default async (ctx: UserCtx, next: any) => {
if (requestAppId) {
const span = tracer.scope().active()
span?.addTags({ app_id: requestAppId })
span?.setBaggageItem("appId", requestAppId)
}
// deny access to application preview
@ -76,6 +76,14 @@ export default async (ctx: UserCtx, next: any) => {
return next()
}
if (ctx.user) {
const span = tracer.scope().active()
if (ctx.user._id) {
span?.setBaggageItem("userId", ctx.user._id)
}
span?.setBaggageItem("tenantId", ctx.user.tenantId)
}
const userId = ctx.user ? generateUserMetadataID(ctx.user._id!) : undefined
// if the user is not in the right tenant then make sure to wipe their cookie