Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

stop attributing outsider API denials to workspace logs

Pedro Ladeira73feb3674618
diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.ts
index 16fa92c034..c97b9028d4 100644
--- a/apps/web/lib/auth/workspace.ts
+++ b/apps/web/lib/auth/workspace.ts
@@ -376,6 +376,10 @@ export const withWorkspace = (
},
});
+ // Clear so non-member denials are not attributed to this workspace
+ // in API logs or Axiom error context.
+ workspace = undefined;
+
if (!pendingInvites) {
throw new DubApiError({
code: "not_found",
@@ -499,7 +503,7 @@ export const withWorkspace = (
token,
});
- if (workspace) {
+ if (workspace?.users?.length) {
waitUntil(
captureRequestLog({
req: reqForLog,
@@ -526,7 +530,7 @@ export const withWorkspace = (
{ headers: responseHeaders, status },
);
- if (workspace) {
+ if (workspace?.users?.length) {
waitUntil(
captureRequestLog({
req: reqForLog,