From b066d1abe7eac13fdeb45f6768b672937bfa69a7 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:41:41 +0200 Subject: [PATCH] fix(sign-in): validate email format before registration attempt Show "Please enter a valid email address" when the user enters a username instead of an email in the sign-up form, rather than letting it hit Logto's API and returning a cryptic 400. Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/sign-in/src/SignInPage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/sign-in/src/SignInPage.tsx b/ui/sign-in/src/SignInPage.tsx index 502feec..a1339c3 100644 --- a/ui/sign-in/src/SignInPage.tsx +++ b/ui/sign-in/src/SignInPage.tsx @@ -103,6 +103,10 @@ export function SignInPage() { const handleRegister = async (e: FormEvent) => { e.preventDefault(); setError(null); + if (!identifier.includes('@')) { + setError('Please enter a valid email address'); + return; + } if (password !== confirmPassword) { setError('Passwords do not match'); return;