oauth: bug fix

This commit is contained in:
undefined committed 2022-02-09 19:26:03 +08:00
1 parent 59739e3d86
commit 363db57ec4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ async function callback({ state, code }) {
); );
} }
const t = res.body.access_token; const t = res.body.access_token;
const userInfo = await superagent.get(`${`${endpoint}/api` || 'https://api.github.com'}/user`) const userInfo = await superagent.get(`${endpoint ? `${endpoint}/api` : 'https://api.github.com'}/user`)
.set('User-Agent', 'Hydro-OAuth') .set('User-Agent', 'Hydro-OAuth')
.set('Accept', 'application/vnd.github.v3+json') .set('Accept', 'application/vnd.github.v3+json')
.set('Authorization', `token ${t}`); .set('Authorization', `token ${t}`);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/login-with-github", "name": "@hydrooj/login-with-github",
"version": "0.1.2", "version": "0.1.3",
"main": "package.json", "main": "package.json",
"repository": "git@github.com:hydro-dev/Hydro.git", "repository": "git@github.com:hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",