diff options
author | Raphael <mail@raphaelkabo.com> | 2024-02-25 21:27:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 21:27:13 +0000 |
commit | 7ff0bebd9fbdf1c982d7cc42a7057d36a3e2486a (patch) | |
tree | 05b1d8b1d63baed174883cc96807051e530969a2 /src/routes/event.ts | |
parent | b17238eb2840553c69fc2dae168be557afbcee9c (diff) | |
parent | cd0f291eb1a608589fcc2c1875fa7099ed8e2c51 (diff) |
Merge pull request #133 from lowercasename/rk/restricted-event-creation
Optionally restrict event creation to specific email addresses
Diffstat (limited to 'src/routes/event.ts')
-rw-r--r-- | src/routes/event.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/routes/event.ts b/src/routes/event.ts index cfd877e..fb9d8c7 100644 --- a/src/routes/event.ts +++ b/src/routes/event.ts @@ -26,6 +26,7 @@ import { sendEmailFromTemplate } from "../lib/email.js"; import crypto from "crypto"; import ical from "ical"; import { markdownToSanitizedHTML } from "../util/markdown.js"; +import { checkMagicLink } from "../lib/middleware.js"; const config = getConfig(); @@ -60,6 +61,7 @@ const router = Router(); router.post( "/event", upload.single("imageUpload"), + checkMagicLink, async (req: Request, res: Response) => { const { data: eventData, errors } = validateEventData(req.body); if (errors && errors.length > 0) { @@ -527,6 +529,7 @@ router.put( router.post( "/import/event", icsUpload.single("icsImportControl"), + checkMagicLink, async (req: Request, res: Response) => { if (!req.file) { return res.status(400).json({ |