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.

bind email-change confirmation to the token's issued account

Pedro Ladeira3b6ce7e26a16
diff --git a/apps/web/app/app.dub.co/(auth)/auth/confirm-email-change/[token]/page.tsx b/apps/web/app/app.dub.co/(auth)/auth/confirm-email-change/[token]/page.tsx
index 1d99a882a2..33604ccfc7 100644
--- a/apps/web/app/app.dub.co/(auth)/auth/confirm-email-change/[token]/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/auth/confirm-email-change/[token]/page.tsx
@@ -81,6 +81,16 @@ const VerifyEmailChange = async ({ params, searchParams }: PageProps) => {
? partnerId
: userId;
+ if (tokenFound.identifier !== identifier) {
+ return (
+ <EmptyState
+ icon={InputPassword}
+ title="Invalid Token"
+ description="This token is invalid or expired. Please request a new one."
+ />
+ );
+ }
+
const data = await redis.get<{
email: string;
newEmail: string;