judge: fix key check

This commit is contained in:
undefined committed 2021-09-22 14:32:08 +08:00
1 parent 1140f85654
commit f21ff16ef1
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.11.3",
"version": "2.11.4",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+2 -2
View File
@@ -229,7 +229,7 @@ export default async function readCases(folder: string, cfg: Record<string, any>
result.subtasks = c.subtasks;
result.count = c.count;
}
if (args.key && args.key !== result.key) throw new FormatError('Incorrect secret key');
if (!args.key) isValidConfig(result);
if (result.key && args.key !== result.key) throw new FormatError('Incorrect secret key');
if (!result.key) isValidConfig(result);
return result;
}