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:
parent
44d5289a2d
commit
ff8a8f5e71
2 changed files with 8 additions and 3 deletions
|
|
@ -157,7 +157,7 @@ const toast = useToast()
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
show: boolean
|
show: boolean
|
||||||
loadingState: boolean
|
loadingState?: boolean
|
||||||
editingProperties: EditingProperties
|
editingProperties: EditingProperties
|
||||||
source: "REST" | "GraphQL"
|
source: "REST" | "GraphQL"
|
||||||
modelValue: string
|
modelValue: string
|
||||||
|
|
|
||||||
|
|
@ -2796,8 +2796,13 @@ const setCollectionProperties = (newCollection: {
|
||||||
path: string
|
path: string
|
||||||
}) => {
|
}) => {
|
||||||
const { collection, path, isRootCollection } = newCollection
|
const { collection, path, isRootCollection } = newCollection
|
||||||
|
|
||||||
if (!collection) return
|
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 (collectionsType.value.type === "my-collections") {
|
||||||
if (isRootCollection) {
|
if (isRootCollection) {
|
||||||
editRESTCollection(parseInt(path), collection)
|
editRESTCollection(parseInt(path), collection)
|
||||||
|
|
@ -2818,13 +2823,13 @@ const setCollectionProperties = (newCollection: {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
toast.success(t("collection.properties_updated"))
|
toast.success(t("collection.properties_updated"))
|
||||||
} else if (hasTeamWriteAccess.value && collection.id) {
|
} else if (hasTeamWriteAccess.value && collectionId) {
|
||||||
const data = {
|
const data = {
|
||||||
auth: collection.auth,
|
auth: collection.auth,
|
||||||
headers: collection.headers,
|
headers: collection.headers,
|
||||||
}
|
}
|
||||||
pipe(
|
pipe(
|
||||||
updateTeamCollection(collection.id, JSON.stringify(data), undefined),
|
updateTeamCollection(collectionId, JSON.stringify(data), undefined),
|
||||||
TE.match(
|
TE.match(
|
||||||
(err: GQLError<string>) => {
|
(err: GQLError<string>) => {
|
||||||
toast.error(`${getErrorMessage(err)}`)
|
toast.error(`${getErrorMessage(err)}`)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue