fix(auth): show confirmation-specific copy when a signup link fails (#1027)

A failed email-verification link redirected to /login?error=auth_error with no
flow context, so the login page framed every callback failure as a broken
password-reset link and pushed new users into a reset form for an account that
was never confirmed. The callback now forwards a coarse flow hint (recovery vs
signup); the login page renders confirmation copy without the reset CTA for the
signup case. The new copy names the likely cause (link opened in a different
browser than signup, or a one-time token consumed by a mail scanner) instead of
only "expired or already used".

Silent-team creation is also wrapped in try/catch so a transient insert failure
cannot turn an otherwise-successful first-time confirmation into a 500.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-07-16 11:20:18 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 072aedeaf9
commit d704714eef
5 changed files with 86 additions and 35 deletions
+2
View File
@@ -276,6 +276,8 @@
"callback_error_title": "The reset link did not work",
"callback_error_body": "The link has expired or has already been used.",
"request_new_reset_link": "Request a new reset link",
"callback_error_title_signup": "The confirmation link did not work",
"callback_error_body_signup": "The link may have expired, already been used, or been opened in a different browser than the one you signed up in. If you have already confirmed your email, sign in below; otherwise you can register again.",
"bankid_no_account_greeting": "Hi {name}!",
"bankid_no_account_body": "We did not find an account linked to your BankID. Sign in with email below and then link BankID in settings.",
"bankid_no_account_create": "Or create a new account",
+2
View File
@@ -276,6 +276,8 @@
"callback_error_title": "Återställningslänken fungerade inte",
"callback_error_body": "Länken har gått ut eller använts redan.",
"request_new_reset_link": "Begär en ny återställningslänk",
"callback_error_title_signup": "Bekräftelselänken fungerade inte",
"callback_error_body_signup": "Länken kan ha upphört, redan använts, eller öppnats i en annan webbläsare än den du registrerade dig i. Har du redan bekräftat din e-post loggar du in nedan, annars kan du registrera dig igen.",
"bankid_no_account_greeting": "Hej {name}!",
"bankid_no_account_body": "Vi hittade inget konto kopplat till ditt BankID. Logga in med e-post nedan och koppla sedan BankID i inställningar.",
"bankid_no_account_create": "Eller skapa ett nytt konto",