Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amateima committed Nov 22, 2024
1 parent 89cb8c1 commit 5d32c0b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/webhooks/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ export function WebhookRouter(deps: Dependencies): express.Router {
) => {
try {
const parsedBody = RegistrationParams.create(req.body);
if (!req.token) {
const token = req.token;
if (!token) {
throw new Error("API Key required");
}
const id = uuidv4();
await deps.eventProcessorManager.registerWebhook(
id,
parsedBody,
req.token as string,
);
await deps.eventProcessorManager.registerWebhook(id, parsedBody, token);
res.status(201).send(id);
} catch (error) {
next(error);
Expand Down

0 comments on commit 5d32c0b

Please sign in to comment.