mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: handle oauth redirect
This commit is contained in:
1 parent
fc95226ce4
commit
d19476d7e7
4 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.11.15",
|
"version": "3.11.16",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ class OauthCallbackHandler extends Handler {
|
|||||||
this.session.uid = _id;
|
this.session.uid = _id;
|
||||||
this.session.scope = PERM.PERM_ALL.toString();
|
this.session.scope = PERM.PERM_ALL.toString();
|
||||||
}
|
}
|
||||||
|
this.response.redirect = '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ async function callback({ state, code }) {
|
|||||||
}
|
}
|
||||||
await token.del(s._id, token.TYPE_OAUTH);
|
await token.del(s._id, token.TYPE_OAUTH);
|
||||||
if (!ret.email) throw new ForbiddenError("You don't have a verified email.");
|
if (!ret.email) throw new ForbiddenError("You don't have a verified email.");
|
||||||
this.response.redirect = (s.redirect || '').endsWith('/login') ? '/' : s.redirect;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/login-with-github",
|
"name": "@hydrooj/login-with-github",
|
||||||
"version": "0.1.5",
|
"version": "0.1.6",
|
||||||
"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>",
|
||||||
|
|||||||
Reference in new issue
Block a user