core: allow websocket server without auth

This commit is contained in:
undefined committed 2022-01-09 05:03:53 +08:00
1 parent 86ead663df
commit fda667c424
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.3.6", "version": "3.3.7",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+2
View File
@@ -868,6 +868,7 @@ export function Connection(
const args = { domainId: 'system', ...h.request.params }; const args = { domainId: 'system', ...h.request.params };
h.args = args; h.args = args;
h.domainId = args.domainId; h.domainId = args.domainId;
if (!h.noAuth) {
const cookie = await new Promise((r) => { const cookie = await new Promise((r) => {
conn.once('data', r); conn.once('data', r);
}); });
@@ -875,6 +876,7 @@ export function Connection(
await h.init(args); await h.init(args);
conn.write(JSON.stringify({ event: 'auth' })); conn.write(JSON.stringify({ event: 'auth' }));
checker.call(h); checker.call(h);
}
if (h._prepare) await h._prepare(args); if (h._prepare) await h._prepare(args);
if (h.prepare) await h.prepare(args); if (h.prepare) await h.prepare(args);