refactor: add fallback for new request auth state
This commit is contained in:
@@ -152,12 +152,16 @@
|
|||||||
<div v-if="auth.authType === 'basic'">
|
<div v-if="auth.authType === 'basic'">
|
||||||
<HttpAuthorizationBasic v-model="auth" />
|
<HttpAuthorizationBasic v-model="auth" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="auth.authType === 'inherit'">
|
<div v-if="auth.authType === 'inherit'" class="p-4">
|
||||||
<div class="p-4">
|
<span v-if="inheritedProperties?.auth">
|
||||||
Inherited
|
Inherited
|
||||||
{{ getAuthName(inheritedProperties?.auth?.authType) }} from Parent
|
{{ getAuthName(inheritedProperties.auth.authType) }} from Parent
|
||||||
Collection {{ inheritedProperties?.parentName }}
|
Collection {{ inheritedProperties?.parentName }}
|
||||||
</div>
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
Please save this request in any collection to inherit the
|
||||||
|
authorization
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="auth.authType === 'bearer'">
|
<div v-if="auth.authType === 'bearer'">
|
||||||
<div class="flex flex-1 border-b border-dividerLight">
|
<div class="flex flex-1 border-b border-dividerLight">
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export const getComputedAuthHeaders = (
|
|||||||
|
|
||||||
if (!request) return []
|
if (!request) return []
|
||||||
|
|
||||||
if (!request.auth.authActive) return []
|
if (!request.auth || !request.auth.authActive) return []
|
||||||
|
|
||||||
const headers: HoppRESTHeader[] = []
|
const headers: HoppRESTHeader[] = []
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ export const getComputedParams = (
|
|||||||
): ComputedParam[] => {
|
): ComputedParam[] => {
|
||||||
// When this gets complex, its best to split this function off (like with getComputedHeaders)
|
// When this gets complex, its best to split this function off (like with getComputedHeaders)
|
||||||
// API-key auth can be added to query params
|
// API-key auth can be added to query params
|
||||||
if (!req.auth.authActive) return []
|
if (!req.auth || !req.auth.authActive) return []
|
||||||
if (req.auth.authType !== "api-key") return []
|
if (req.auth.authType !== "api-key") return []
|
||||||
if (req.auth.addTo !== "Query params") return []
|
if (req.auth.addTo !== "Query params") return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user