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.

remove isWhitelistedEmail

Steven Tey1be8e8ff538e
diff --git a/apps/web/app/api/auth/account-exists/route.ts b/apps/web/app/api/auth/account-exists/route.ts
index b601ca838b..7e9a82fbc8 100644
--- a/apps/web/app/api/auth/account-exists/route.ts
+++ b/apps/web/app/api/auth/account-exists/route.ts
@@ -1,4 +1,3 @@
-import { isWhitelistedEmail } from "@/lib/edge-config";
import { conn } from "@/lib/planetscale";
import { ratelimit } from "@/lib/upstash";
import { ipAddress } from "@vercel/functions";
@@ -30,13 +29,5 @@ export async function POST(req: NextRequest) {
});
}
- const whitelisted = await isWhitelistedEmail(email);
- if (whitelisted) {
- return NextResponse.json({
- accountExists: true,
- hasPassword: false,
- });
- }
-
return NextResponse.json({ accountExists: false, hasPassword: false });
}
diff --git a/apps/web/lib/edge-config/index.ts b/apps/web/lib/edge-config/index.ts
index 6c6de5fd4c..add50cb567 100644
--- a/apps/web/lib/edge-config/index.ts
+++ b/apps/web/lib/edge-config/index.ts
@@ -5,6 +5,5 @@ export * from "./is-blacklisted-key";
export * from "./is-blacklisted-referrer";
export * from "./is-reserved-key";
export * from "./is-reserved-username";
-export * from "./is-whitelisted-email";
export * from "./update";
export * from "./user-is-in-beta";
diff --git a/apps/web/lib/edge-config/is-whitelisted-email.ts b/apps/web/lib/edge-config/is-whitelisted-email.ts
deleted file mode 100644
index 4638c56769..0000000000
--- a/apps/web/lib/edge-config/is-whitelisted-email.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { get } from "@vercel/edge-config";
-
-export const isWhitelistedEmail = async (email: string) => {
- if (!process.env.NEXT_PUBLIC_IS_DUB || !process.env.EDGE_CONFIG) {
- return false;
- }
-
- let whitelistedEmails;
- try {
- whitelistedEmails = await get("whitelistedEmails");
- } catch (e) {
- whitelistedEmails = [];
- }
- return whitelistedEmails.includes(email);
-};