Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stackexchange OAuth switch
const _u = URL.parse(provider.url);
const hostSite = _u.host.replace(/[.]com/g, '').replace(/[.]stackexchange/g, '');
const params = {
url: 'https://api.stackexchange.com/2.2/me',
responseType: 'json',
oauth: oauth,
query: {
order: 'desc',
filter: 'withbody',
site: (hostSite === '') ? 'stackoverflow' : hostSite,
access_token: oauth.access_token,
key: provider.apiKey
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.