From cd173e67e4e0514271371f4a5e5136f7f61d06d1 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Tue, 29 Sep 2026 11:47:48 -0700 Subject: Redemption Modal. Redemption Magic flow. User Account Icon --- jb-ui/src/pages/MagicLink.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'jb-ui/src/pages/MagicLink.tsx') diff --git a/jb-ui/src/pages/MagicLink.tsx b/jb-ui/src/pages/MagicLink.tsx index 48d7dc5..e85bac3 100644 --- a/jb-ui/src/pages/MagicLink.tsx +++ b/jb-ui/src/pages/MagicLink.tsx @@ -5,6 +5,7 @@ type ExchangeState = "working" | "failed" | "missing"; const MagicLink = function () { const started = useRef(false); const [state, setState] = useState("working"); + const [errorMsg, setErrorMesg] = useState(""); useEffect(() => { // React Strict Mode runs effects twice in development. Never redeem twice. @@ -31,14 +32,19 @@ const MagicLink = function () { if (!response.ok) throw new Error("Magic-link exchange failed"); window.location.replace("/"); }) - .catch(() => setState("failed")); + .catch((err) => { + const response = err?.response?.data; + setErrorMesg(response?.detail ?? err.message); + setState("failed"); + }); }, []); if (state === "missing") { return

This login link is missing its token.

; } if (state === "failed") { - return

This login link is invalid or has expired.

; + return

{errorMsg}

; + // return

This login link is invalid or has expired.

; } return

Signing you in…

; }; -- cgit v1.2.3