Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
}
if (url.includes(serverConfig.oauth.access_url)) {
return makeMockFetchResponse({
oauth_token: expectedOauthToken,
refresh_token: 'whatever',
});
}
return makeMockFetchResponse({});
});
const fooRoute = {
method: 'get',
path: '/foo',
handler: (request, reply) => reply(expectedResponse),
};
const server = getServer();
return server
.register({
register: requestAuthPlugin,
options: serverConfig,
})
.then(() => server.route(fooRoute))
.then(() => server.auth.strategy('default', 'oauth', 'required'))
.then(() => server.inject(makeRequest(cookies)))
.then(test)
.then(() => server.stop());
};