Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Hoek.assert(!options.credentials, 'options.credentials no longer supported (use options.auth)');
if (options.auth) {
Hoek.assert(typeof options.auth === 'object', 'options.auth must be an object');
Hoek.assert(options.auth.credentials, 'options.auth.credentials is missing');
Hoek.assert(options.auth.strategy, 'options.auth.strategy is missing');
}
const needle = this._core._dispatch({
auth: options.auth,
allowInternals: options.allowInternals,
app: options.app,
plugins: options.plugins
});
const res = await Shot.inject(needle, settings);
const custom = res.raw.res[Config.symbol];
if (custom) {
res.result = custom.result;
res.request = custom.request;
delete res.raw.res[Config.symbol];
}
if (res.result === undefined) {
res.result = res.payload;
}
return res;
}