Unnest
This commit is contained in:
parent
c1fe41a588
commit
542594baeb
|
@ -381,12 +381,19 @@ export class RestIntegration implements IntegrationBase {
|
||||||
authConfigId?: string,
|
authConfigId?: string,
|
||||||
authConfigType?: RestAuthType
|
authConfigType?: RestAuthType
|
||||||
): Promise<{ [key: string]: any }> {
|
): Promise<{ [key: string]: any }> {
|
||||||
let headers: any = {}
|
if (!authConfigId) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
if (authConfigId) {
|
|
||||||
if (authConfigType === RestAuthType.OAUTH2) {
|
if (authConfigType === RestAuthType.OAUTH2) {
|
||||||
headers.Authorization = await sdk.oauth2.generateToken(authConfigId)
|
return { Authorization: await sdk.oauth2.generateToken(authConfigId) }
|
||||||
} else if (this.config.authConfigs) {
|
}
|
||||||
|
|
||||||
|
if (!this.config.authConfigs) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
let headers: any = {}
|
||||||
const authConfig = this.config.authConfigs.filter(
|
const authConfig = this.config.authConfigs.filter(
|
||||||
c => c._id === authConfigId
|
c => c._id === authConfigId
|
||||||
)[0]
|
)[0]
|
||||||
|
@ -407,8 +414,6 @@ export class RestIntegration implements IntegrationBase {
|
||||||
throw utils.unreachable(type)
|
throw utils.unreachable(type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return headers
|
return headers
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue