Merge branch 'master' into fix/password-length-admin-user-startup

This commit is contained in:
Michael Drury 2024-01-05 14:06:37 +00:00 committed by GitHub
commit 9004428ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import * as identity from "../context/identity"
import env from "../environment"
import { Ctx, EndpointMatcher, SessionCookie } from "@budibase/types"
import { InvalidAPIKeyError, ErrorCode } from "../errors"
import tracer from "dd-trace"
const ONE_MINUTE = env.SESSION_UPDATE_PERIOD
? parseInt(env.SESSION_UPDATE_PERIOD)
@ -166,6 +167,19 @@ export default function (
if (!authenticated) {
authenticated = false
}
if (user) {
tracer.setUser({
id: user?.id,
tenantId: user?.tenantId,
admin: user?.admin,
builder: user?.builder,
budibaseAccess: user?.budibaseAccess,
status: user?.status,
roles: user?.roles,
})
}
// isAuthenticated is a function, so use a variable to be able to check authed state
finalise(ctx, { authenticated, user, internal, version, publicEndpoint })