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.

Update index.ts

Steven Tey608e9db46018
diff --git a/apps/web/lib/auth/index.ts b/apps/web/lib/auth/index.ts
index 41d53a5cb1..8ce08ed82e 100644
--- a/apps/web/lib/auth/index.ts
+++ b/apps/web/lib/auth/index.ts
@@ -119,7 +119,8 @@ export const withAuth = (
try {
// if there's no projectSlug defined
if (!slug) {
- if (allowAnonymous) {
+ // for /api/links (POST /api/links) – allow no session (but warn if user provides apiKey)
+ if (allowAnonymous && !apiKey) {
// @ts-expect-error
return handler({
req,