We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d631e39 commit 336f426Copy full SHA for 336f426
middleware/passport.js
@@ -44,6 +44,9 @@ module.exports = async function checkAuth(ctx, next) {
44
if (!code) {
45
ctx.body = fail({ message: "请先登录~", code: 91 });
46
return;
47
+ } else if (code.length !== 20) {
48
+ ctx.body = fail({ message: "code 码无效,请重新登录", code: 92 });
49
+ return;
50
}
51
const { access_token } = await fetch(
52
`https://github.com/login/oauth/access_token?code=${code}&client_id=${clientId}&client_secret=${secret}`,
0 commit comments