From 4051594b2f410f01e883febad22eb9001a84f90e Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 1 Feb 2026 17:20:17 +0000
Subject: feat: add support for redirectUrl after signup (#2439)

* feat: add support for redirectUrl after signup

* pr review

* more fixes

* format

* another fix
---
 apps/web/app/check-email/page.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'apps/web/app/check-email/page.tsx')

diff --git a/apps/web/app/check-email/page.tsx b/apps/web/app/check-email/page.tsx
index 2fbc47fe..50eed4bd 100644
--- a/apps/web/app/check-email/page.tsx
+++ b/apps/web/app/check-email/page.tsx
@@ -15,6 +15,7 @@ import { useMutation } from "@tanstack/react-query";
 import { Loader2, Mail } from "lucide-react";
 
 import { useTRPC } from "@karakeep/shared-react/trpc";
+import { validateRedirectUrl } from "@karakeep/shared/utils/redirectUrl";
 
 export default function CheckEmailPage() {
   const api = useTRPC();
@@ -23,6 +24,8 @@ export default function CheckEmailPage() {
   const [message, setMessage] = useState("");
 
   const email = searchParams.get("email");
+  const redirectUrl =
+    validateRedirectUrl(searchParams.get("redirectUrl")) ?? "/";
 
   const resendEmailMutation = useMutation(
     api.users.resendVerificationEmail.mutationOptions({
@@ -39,7 +42,7 @@ export default function CheckEmailPage() {
 
   const handleResendEmail = () => {
     if (email) {
-      resendEmailMutation.mutate({ email });
+      resendEmailMutation.mutate({ email, redirectUrl });
     }
   };
 
-- 
cgit v1.2.3-70-g09d2

