-
-
Save sebilasse/db6eaf82c42be4e9692c8b1623f8295b to your computer and use it in GitHub Desktop.
stackexchange OAuth switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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