由于该项目过于简单,暂不发布。请直接查阅源码
const SDK = require('@xibang/github-oauth-sdk');
const sdk = SDK({
client_id: 'xxx',
client_secret: 'xxx',
redirect_uri: 'http://xxxx/callback/github'
});
console.log(sdk.authorize_url({
scope: 'user',
state: 'testxxx'
}));
const SDK = require('@xibang/github-oauth-sdk');
const sdk = SDK({
client_id: 'xxx',
client_secret: 'xxx',
redirect_uri: 'http://xxxx/callback/github'
});
sdk.access_token({ code: 'xxxxxx' }).then(console.log);
// { access_token: 'xxxxxx',
// token_type: 'bearer',
// scope: 'user' }
Apache 2.0
通过支付宝捐赠: