mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: allow websocket server without auth
This commit is contained in:
1 parent
86ead663df
commit
fda667c424
2 files changed
+10
-8
No files matched your search
@@ -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",
|
||||||
|
|||||||
@@ -868,13 +868,15 @@ 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;
|
||||||
const cookie = await new Promise((r) => {
|
if (!h.noAuth) {
|
||||||
conn.once('data', r);
|
const cookie = await new Promise((r) => {
|
||||||
});
|
conn.once('data', r);
|
||||||
args.cookie = cookie;
|
});
|
||||||
await h.init(args);
|
args.cookie = cookie;
|
||||||
conn.write(JSON.stringify({ event: 'auth' }));
|
await h.init(args);
|
||||||
checker.call(h);
|
conn.write(JSON.stringify({ event: 'auth' }));
|
||||||
|
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);
|
||||||
|
|||||||
Reference in new issue
Block a user