mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bump version
This commit is contained in:
21 files changed
+58
-40
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "4.7.9",
|
||||
"version": "4.8.0",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/plugin-api",
|
||||
"module": "src/plugin-api",
|
||||
@@ -12,11 +12,11 @@
|
||||
},
|
||||
"preferUnplugged": true,
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.279.0",
|
||||
"@aws-sdk/lib-storage": "^3.279.0",
|
||||
"@aws-sdk/middleware-endpoint": "^3.272.0",
|
||||
"@aws-sdk/s3-presigned-post": "^3.279.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.279.0",
|
||||
"@aws-sdk/client-s3": "^3.282.0",
|
||||
"@aws-sdk/lib-storage": "^3.282.0",
|
||||
"@aws-sdk/middleware-endpoint": "^3.282.0",
|
||||
"@aws-sdk/s3-presigned-post": "^3.282.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.282.0",
|
||||
"@graphql-tools/schema": "^9.0.16",
|
||||
"@hydrooj/utils": "workspace:*",
|
||||
"@simplewebauthn/server": "^7.0.1",
|
||||
|
||||
@@ -94,8 +94,12 @@ class UserLoginHandler extends Handler {
|
||||
let udoc = await user.getByEmail(domainId, uname);
|
||||
udoc ||= await user.getByUname(domainId, uname);
|
||||
if (!udoc) throw new UserNotFoundError(uname);
|
||||
if (system.get('system.contestmode') && udoc._loginip && udoc._loginip !== this.request.ip) {
|
||||
if (!udoc.hasPriv(PRIV.PRIV_EDIT_SYSTEM)) throw new ValidationError('ip');
|
||||
if (system.get('system.contestmode') && !udoc.hasPriv(PRIV.PRIV_EDIT_SYSTEM)) {
|
||||
if (udoc._loginip && udoc._loginip !== this.request.ip) throw new ValidationError('ip');
|
||||
if (system.get('system.contestmode') === 'strict') {
|
||||
const udocs = await user.getMulti({ loginip: this.request.ip, _id: { $ne: udoc._id } }).toArray();
|
||||
if (udocs.length) throw new ValidationError('ip');
|
||||
}
|
||||
}
|
||||
await Promise.all([
|
||||
this.limitRate('user_login', 60, 30, false),
|
||||
|
||||
Reference in new issue
Block a user