Email confirmed
-Open the One Concept app on your phone and sign in to get today's concept.
+Check your email link
+Open the confirmation link from your email to finish setting up your account.
diff --git a/admin/public/confirmed.js b/admin/public/confirmed.js index b784aef9..c2cccb96 100644 --- a/admin/public/confirmed.js +++ b/admin/public/confirmed.js @@ -1,3 +1,22 @@ -// Supabase may return a short-lived session in the URL fragment after -// confirmation. This informational page never needs it. -if (location.hash || location.search) history.replaceState(null, '', location.pathname); +// Supabase verifies the link before redirecting here. The page must not claim +// success on a direct visit, and it never needs to retain a returned session. +const hash = new URLSearchParams(location.hash.slice(1)); +const query = new URLSearchParams(location.search); +const error = hash.get('error_description') || query.get('error_description') || + hash.get('error') || query.get('error'); +if (hash.get('type') === 'recovery' && hash.get('access_token') && !error) { + const reset = new URL('/reset-password', location.origin); + reset.hash = location.hash; + location.replace(reset.toString()); +} else { + history.replaceState(null, '', location.pathname); + const heading = document.getElementById('heading'); + const message = document.getElementById('message'); + if (error) { + heading.textContent = 'Confirmation did not finish'; + message.textContent = error; + } else if (hash.get('access_token')) { + heading.textContent = 'Email confirmed ✓'; + message.textContent = "You're all set. Open the One Concept app and sign in to get today's concept."; + } +} diff --git a/admin/public/confirmed/index.html b/admin/public/confirmed/index.html index 55b83f85..f2760ab5 100644 --- a/admin/public/confirmed/index.html +++ b/admin/public/confirmed/index.html @@ -3,14 +3,14 @@
-Open the One Concept app on your phone and sign in to get today's concept.
+Open the confirmation link from your email to finish setting up your account.