test
This commit is contained in:
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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user