1
0
Fork 0
mirror of synced 2024-10-01 09:38:55 +13:00

Fix for integration test, make sure to carry auth headers over correctly.

This commit is contained in:
mike12345567 2024-02-15 15:47:56 +00:00
parent 77fdc69f15
commit 1f4a254ec5
2 changed files with 10 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import {
tenancy,
logging,
env as coreEnv,
utils,
} from "@budibase/backend-core"
import { Ctx, User, EmailInvite } from "@budibase/types"
@ -25,6 +26,14 @@ export function request(ctx?: Ctx, request?: any) {
request.headers[header] = ctx.headers[header]
}
}
// 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",
}