core: add noCheckPermView for register

This commit is contained in:
undefined committed 2021-10-29 11:31:11 +08:00
1 parent 5272a35b09
commit 84f419f6f0
2 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.1.15", "version": "3.1.16",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+10
View File
@@ -153,6 +153,8 @@ export class UserRegisterHandler extends Handler {
} }
class UserRegisterWithCodeHandler extends Handler { class UserRegisterWithCodeHandler extends Handler {
noCheckPermView = true;
@param('code', Types.String) @param('code', Types.String)
async get(domainId: string, code: string) { async get(domainId: string, code: string) {
this.response.template = 'user_register_with_code.html'; this.response.template = 'user_register_with_code.html';
@@ -188,6 +190,8 @@ class UserRegisterWithCodeHandler extends Handler {
} }
class UserLostPassHandler extends Handler { class UserLostPassHandler extends Handler {
noCheckPermView = true;
async get() { async get() {
this.response.template = 'user_lostpass.html'; this.response.template = 'user_lostpass.html';
} }
@@ -215,6 +219,8 @@ class UserLostPassHandler extends Handler {
} }
class UserLostPassWithCodeHandler extends Handler { class UserLostPassWithCodeHandler extends Handler {
noCheckPermView = true;
async get({ domainId, code }) { async get({ domainId, code }) {
const tdoc = await token.get(code, token.TYPE_LOSTPASS); const tdoc = await token.get(code, token.TYPE_LOSTPASS);
if (!tdoc) throw new InvalidTokenError(token.TYPE_LOSTPASS, code); if (!tdoc) throw new InvalidTokenError(token.TYPE_LOSTPASS, code);
@@ -273,6 +279,8 @@ class UserDeleteHandler extends Handler {
} }
class OauthHandler extends Handler { class OauthHandler extends Handler {
noCheckPermView = true;
@param('type', Types.String) @param('type', Types.String)
async get(domainId: string, type: string) { async get(domainId: string, type: string) {
if (global.Hydro.lib[`oauth_${type}`]) await global.Hydro.lib[`oauth_${type}`].get.call(this); if (global.Hydro.lib[`oauth_${type}`]) await global.Hydro.lib[`oauth_${type}`].get.call(this);
@@ -280,6 +288,8 @@ class OauthHandler extends Handler {
} }
class OauthCallbackHandler extends Handler { class OauthCallbackHandler extends Handler {
noCheckPermView = true;
async get(args: any) { async get(args: any) {
let r; let r;
if (global.Hydro.lib[`oauth_${args.type}`]) r = await global.Hydro.lib[`oauth_${args.type}`].callback.call(this, args); if (global.Hydro.lib[`oauth_${args.type}`]) r = await global.Hydro.lib[`oauth_${args.type}`].callback.call(this, args);