2
나는 passport-github
전략을 사용하고 있습니다. API를 통해 요령을 게시하는 방법 (익명으로 아님)
passport.use(new Strategy({
clientID: "...",
clientSecret: "...",
callbackURL: 'http://localhost:3000/login/github/return',
scope: 'gist'
},
function(accessToken, refreshToken, profile, cb) {
return cb(null, profile);
}));
는 다음 나는
POST
요청
app.get('/profile/post',
require('connect-ensure-login').ensureLoggedIn(),
function(req, res){
var url = 'https://api.github.com/gists';
axios.post(url, {
method: "POST",
"description": "POSTING FROM EXPRESS",
"public": true,
"files": {
"file1.txt": {
"content": "EXPRESS "
}
}
})
.then(function (response) {...})
.catch(function (error) { ... });
요지가 생성됩니다
그러나 익명을합니다.
요청 인수의 일부로 "owner"
과 "user"
을 전달했지만 사용하지 못했습니다. 나는 또한 사용자 이름을 URL에 전달하려고 시도했다.
까지 나는 the docs에 대해 아무 말도하지 않는다.