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.

naming is hard

Steven Tey7c9a0191f2b5
diff --git a/lib/auth.ts b/lib/auth.ts
index 9eb96487e2..fc440da168 100644
--- a/lib/auth.ts
+++ b/lib/auth.ts
@@ -32,7 +32,7 @@ interface CustomNextApiHandler {
}
const withProjectAuth =
- (handler: CustomNextApiHandler, requireValidDomain?: boolean) =>
+ (handler: CustomNextApiHandler, extraAuth?: boolean) =>
// TODO - fix `handler` type when we figure it out
// `isWriteEditLink` is only true when it's a POST or PUT request for links
// (you can't add/edit a link when domain is not configured)
@@ -70,7 +70,7 @@ const withProjectAuth =
if (!project) return res.status(404).json({ error: "Project not found" });
- if (requireValidDomain && req.method !== "GET") {
+ if (extraAuth && req.method !== "GET") {
if (!project.domainVerified) {
return res
.status(401)