From 7701a34d7f909994ea85410527c723254a22780f Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:08:26 +0200 Subject: [PATCH] feat(pitch-deck): redirect to pitch if valid session on magic link re-click MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an investor clicks the magic link again after already being logged in, check /api/auth/me first — valid session → redirect to / immediately instead of showing the 'link already used' error. Co-Authored-By: Claude Sonnet 4.6 --- pitch-deck/app/auth/verify/page.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pitch-deck/app/auth/verify/page.tsx b/pitch-deck/app/auth/verify/page.tsx index cd2b5d3..38ced73 100644 --- a/pitch-deck/app/auth/verify/page.tsx +++ b/pitch-deck/app/auth/verify/page.tsx @@ -21,6 +21,13 @@ function VerifyContent() { async function verify() { try { + // If the investor already has a valid session, skip token verification + const sessionCheck = await fetch('/api/auth/me') + if (sessionCheck.ok) { + router.push('/') + return + } + const res = await fetch('/api/auth/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' },