Skip to content

Commit ff8a8f5

Browse files
mayank-jain-1010Mayanknivedinjamesgeorge007
authored
fix: auth tokens not propagating to child requests (hoppscotch#5154)
Co-authored-by: Mayank <[email protected]> Co-authored-by: nivedin <[email protected]> Co-authored-by: jamesgeorge007 <[email protected]>
1 parent 44d5289 commit ff8a8f5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/hoppscotch-common/src/components/collections/Properties.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const toast = useToast()
157157
const props = withDefaults(
158158
defineProps<{
159159
show: boolean
160-
loadingState: boolean
160+
loadingState?: boolean
161161
editingProperties: EditingProperties
162162
source: "REST" | "GraphQL"
163163
modelValue: string

packages/hoppscotch-common/src/components/collections/index.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,8 +2796,13 @@ const setCollectionProperties = (newCollection: {
27962796
path: string
27972797
}) => {
27982798
const { collection, path, isRootCollection } = newCollection
2799+
27992800
if (!collection) return
28002801
2802+
// We default to using collection.id but during the callback to our application, collection.id is not being preserved.
2803+
// Since path is being preserved, we extract the collectionId from path instead
2804+
const collectionId = collection.id ?? path.split("/").pop()
2805+
28012806
if (collectionsType.value.type === "my-collections") {
28022807
if (isRootCollection) {
28032808
editRESTCollection(parseInt(path), collection)
@@ -2818,13 +2823,13 @@ const setCollectionProperties = (newCollection: {
28182823
)
28192824
})
28202825
toast.success(t("collection.properties_updated"))
2821-
} else if (hasTeamWriteAccess.value && collection.id) {
2826+
} else if (hasTeamWriteAccess.value && collectionId) {
28222827
const data = {
28232828
auth: collection.auth,
28242829
headers: collection.headers,
28252830
}
28262831
pipe(
2827-
updateTeamCollection(collection.id, JSON.stringify(data), undefined),
2832+
updateTeamCollection(collectionId, JSON.stringify(data), undefined),
28282833
TE.match(
28292834
(err: GQLError<string>) => {
28302835
toast.error(`${getErrorMessage(err)}`)

0 commit comments

Comments
 (0)