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:
mike12345567 2024-02-15 16:18:35 +00:00
commit cc0619c5be
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/docker_run.sh .
COPY packages/server/builder/ builder/ COPY packages/server/builder/ builder/
COPY packages/server/client/ client/ COPY packages/server/client/ client/
COPY packages/server/pm2.config.js .
ARG BUDIBASE_VERSION ARG BUDIBASE_VERSION
ARG GIT_COMMIT_SHA ARG GIT_COMMIT_SHA

View File

@ -13,6 +13,7 @@ import {
tenancy, tenancy,
logging, logging,
env as coreEnv, env as coreEnv,
utils,
} from "@budibase/backend-core" } from "@budibase/backend-core"
import { Ctx, User, EmailInvite } from "@budibase/types" import { Ctx, User, EmailInvite } from "@budibase/types"
@ -63,6 +64,14 @@ export function request(request: RequestInit & { ctx?: Ctx }): RequestInit {
request.headers.set(header, value) request.headers.set(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 // apply tenancy if its available

View File

@ -16,4 +16,5 @@ export enum Header {
CORRELATION_ID = "x-budibase-correlation-id", CORRELATION_ID = "x-budibase-correlation-id",
AUTHORIZATION = "authorization", AUTHORIZATION = "authorization",
MIGRATING_APP = "x-budibase-migrating-app", 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/dist/ dist/
COPY packages/worker/docker_run.sh . COPY packages/worker/docker_run.sh .
COPY packages/server/pm2.config.js .
EXPOSE 4001 EXPOSE 4001