Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: exclude link.created webhook when token present
Marc Seitz7f38505b7a9a
diff --git a/pages/api/teams/[teamId]/documents/index.ts b/pages/api/teams/[teamId]/documents/index.tsindex 8820e380..0698be2b 100644--- a/pages/api/teams/[teamId]/documents/index.ts+++ b/pages/api/teams/[teamId]/documents/index.ts@@ -215,9 +215,10 @@ export default async function handle(// Check for API token firstconst authHeader = req.headers.authorization;let userId: string;+ let token: string | null = null;if (authHeader?.startsWith("Bearer ")) {- const token = authHeader.replace("Bearer ", "");+ token = authHeader.replace("Bearer ", "");const hashedToken = hashToken(token);// Look up token in database@@ -442,6 +443,7 @@ export default async function handle(},}),createLink &&+ !token && // INFO: only send webhook if there is no tokensendLinkCreatedWebhook({teamId,data: {