* chore: live server code splitting * chore: update import paths * chore: update bebel path alias * fix: document types type * chore: updated error messages
17 lines
No EOL
528 B
TypeScript
17 lines
No EOL
528 B
TypeScript
import { ConnectionConfiguration } from "@hocuspocus/server";
|
|
// types
|
|
import { TDocumentTypes } from "@/core/types/common.js";
|
|
|
|
type TArgs = {
|
|
connection: ConnectionConfiguration
|
|
cookie: string | undefined;
|
|
params: URLSearchParams;
|
|
}
|
|
|
|
export const authenticateUser = (args: TArgs): Promise<void> => {
|
|
const { params } = args;
|
|
const documentType = params.get("documentType")?.toString() as
|
|
| TDocumentTypes
|
|
| undefined;
|
|
throw Error(`Authentication failed: Invalid document type ${documentType} provided.`);
|
|
} |