Skip to content

Commit

Permalink
[client] Fix withCredentials override not being applied (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Jun 18, 2019
1 parent a690a08 commit 3e6ef9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/@sanity/client/src/http/requestOptions.js
Expand Up @@ -14,11 +14,17 @@ module.exports = (config, overrides = {}) => {
headers[projectHeader] = config.projectId
}

const withCredentials = Boolean(
typeof overrides.withCredentials === 'undefined'
? config.token || config.withCredentials
: overrides.withCredentials
)

const timeout = typeof overrides.timeout === 'undefined' ? config.timeout : overrides.timeout
return assign({}, overrides, {
headers: assign({}, headers, overrides.headers || {}),
timeout: typeof timeout === 'undefined' ? 5 * 60 * 1000 : timeout,
json: true,
withCredentials: Boolean(config.token || config.withCredentials)
withCredentials
})
}

0 comments on commit 3e6ef9d

Please sign in to comment.