Fix for integration test, make sure to carry auth headers over correctly.
This commit is contained in:
parent
77fdc69f15
commit
1f4a254ec5
|
@ -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
|
||||
|
|
|
@ -16,4 +16,5 @@ export enum Header {
|
|||
CORRELATION_ID = "x-budibase-correlation-id",
|
||||
AUTHORIZATION = "authorization",
|
||||
MIGRATING_APP = "x-budibase-migrating-app",
|
||||
COOKIE = "cookie",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue