fix: auth tokens not propagating to child requests (#5154)

Co-authored-by: Mayank <mayank@Mayanks-MacBook-Pro.local>
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Mayank Jain 2025-06-17 12:39:42 +05:30 committed by GitHub
parent 44d5289a2d
commit ff8a8f5e71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -157,7 +157,7 @@ const toast = useToast()
const props = withDefaults(
defineProps<{
show: boolean
loadingState: boolean
loadingState?: boolean
editingProperties: EditingProperties
source: "REST" | "GraphQL"
modelValue: string

View file

@ -2796,8 +2796,13 @@ const setCollectionProperties = (newCollection: {
path: string
}) => {
const { collection, path, isRootCollection } = newCollection
if (!collection) return
// We default to using collection.id but during the callback to our application, collection.id is not being preserved.
// Since path is being preserved, we extract the collectionId from path instead
const collectionId = collection.id ?? path.split("/").pop()
if (collectionsType.value.type === "my-collections") {
if (isRootCollection) {
editRESTCollection(parseInt(path), collection)
@ -2818,13 +2823,13 @@ const setCollectionProperties = (newCollection: {
)
})
toast.success(t("collection.properties_updated"))
} else if (hasTeamWriteAccess.value && collection.id) {
} else if (hasTeamWriteAccess.value && collectionId) {
const data = {
auth: collection.auth,
headers: collection.headers,
}
pipe(
updateTeamCollection(collection.id, JSON.stringify(data), undefined),
updateTeamCollection(collectionId, JSON.stringify(data), undefined),
TE.match(
(err: GQLError<string>) => {
toast.error(`${getErrorMessage(err)}`)