Merge branch 'revert-13047-revert-13043-fix/updating-users-via-public-api' of github.com:budibase/budibase into type-worker-requests

This commit is contained in:
Sam Rose 2024-02-15 16:09:35 +00:00
commit d04416b7c7
No known key found for this signature in database
4 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,7 @@ COPY packages/server/dist/ dist/
COPY packages/server/docker_run.sh .
COPY packages/server/builder/ builder/
COPY packages/server/client/ client/
COPY packages/server/pm2.config.js .
ARG BUDIBASE_VERSION
ARG GIT_COMMIT_SHA

View File

@ -13,6 +13,7 @@ import {
tenancy,
logging,
env as coreEnv,
utils,
} from "@budibase/backend-core"
import { Ctx, User, EmailInvite } from "@budibase/types"
@ -70,6 +71,14 @@ export function createRequest(request: Request): RequestInit {
headers[header] = value
}
}
// be specific about auth headers
const cookie = ctx.headers[constants.Header.COOKIE],
apiKey = ctx.headers[constants.Header.API_KEY]
if (cookie) {
request.headers[constants.Header.COOKIE] = cookie
} else if (apiKey) {
request.headers[constants.Header.API_KEY] = apiKey
}
}
// apply tenancy if its available

View File

@ -16,4 +16,5 @@ export enum Header {
CORRELATION_ID = "x-budibase-correlation-id",
AUTHORIZATION = "authorization",
MIGRATING_APP = "x-budibase-migrating-app",
COOKIE = "cookie",
}

View File

@ -37,6 +37,7 @@ RUN apk del .gyp \
COPY packages/worker/dist/ dist/
COPY packages/worker/docker_run.sh .
COPY packages/server/pm2.config.js .
EXPOSE 4001