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({
|
||||
async onConnect({ connection }) {
|
||||
connection.requiresAuthentication = false;
|
||||
const server = Server.configure({
|
||||
async onAuthenticate(data) {
|
||||
const { token } = data;
|
||||
|
||||
if (token !== "hocuspocus-token") {
|
||||
throw new Error("Not authorized!");
|
||||
}
|
||||
},
|
||||
port: 4242,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user