fix(12): IN-04 trim email before sending to /api/setup/credential
email.trim() was already used in the saveDisabled guard but not applied to the mutate call payload. A non-empty value with leading/trailing spaces would pass the guard and reach the server untrimmed, causing Zod's z.string().email() to reject it with a generic 400 and no diagnostic path for the user. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b0b5bceaed
commit
c86cff5dad
@@ -772,7 +772,7 @@ function Step3Credential({ onBack, onSuccess, onLocked, stepHeadingRef }: Step3P
|
|||||||
if (saveDisabled) return;
|
if (saveDisabled) return;
|
||||||
setValidationState('idle');
|
setValidationState('idle');
|
||||||
setCredentialVerified(false);
|
setCredentialVerified(false);
|
||||||
completeMutation.mutate({ fastmailEmail: email, appPassword: password });
|
completeMutation.mutate({ fastmailEmail: email.trim(), appPassword: password });
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleComplete() {
|
function handleComplete() {
|
||||||
|
|||||||
Reference in New Issue
Block a user