test
This commit is contained in:
parent
44a0b3cd58
commit
38884ccbc0
12
index.js
12
index.js
|
@ -1,8 +1,12 @@
|
||||||
import { Hocuspocus } from "@hocuspocus/server";
|
import { Server } from "@hocuspocus/server";
|
||||||
|
|
||||||
const server = new Hocuspocus({
|
const server = Server.configure({
|
||||||
async onConnect({ connection }) {
|
async onAuthenticate(data) {
|
||||||
connection.requiresAuthentication = false;
|
const { token } = data;
|
||||||
|
|
||||||
|
if (token !== "hocuspocus-token") {
|
||||||
|
throw new Error("Not authorized!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
port: 4242,
|
port: 4242,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user