Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function clientWrapper(manifest, configPath) {
const requester = client.requester.clone()
requester.use(authErrors())
return function(opts = {}) {
const {requireUser, requireProject, api} = {...defaults, ...opts}
const userConfig = getUserConfig()
const userApiConf = userConfig.get('api')
const token = envAuthToken || userConfig.get('authToken')
const apiHost = apiHosts[sanityEnv]
const apiConfig = Object.assign(
{},
userApiConf || {},
(manifest && manifest.api) || {},
api || {}
)
if (apiHost) {