Skip to content

feat(experimental): normalize emails during schema validate - #197

Merged
ping-maxwell merged 1 commit into
better-auth:experimentalfrom
ping-maxwell:feat/experimental-email-normalize
Sep 1, 2026
Merged

feat(experimental): normalize emails during schema validate#197
ping-maxwell merged 1 commit into
better-auth:experimentalfrom
ping-maxwell:feat/experimental-email-normalize

Conversation

@ping-maxwell

Copy link
Copy Markdown
Collaborator

Summary

email: true now trims and lowercases the value before the format check, so padded or mixed-case addresses validate and handlers always see a canonical form. Also switches the email regex to Zod's practical filter.

Trim and lowercase email strings before the format check so handlers always see a canonical address, and tighten the email regex to Zod's practical filter.
@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/better-call@197

commit: 80a7602

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

The PR updates the experimental email rule to trim and lowercase strings before validation and user transforms, while replacing the previous permissive format check with a narrower practical regex.

  • Documents email normalization in the string-rule contract.
  • Adds tests for canonical output, malformed input, and transform ordering.
  • Updates an existing email fixture to satisfy the new format check.

Confidence Score: 5/5

The PR appears safe to merge with the intended email normalization and validation behavior covered by focused tests.

The normalized value is deliberately passed through subsequent rules and transforms, malformed values remain rejected, and no concrete repository path establishes an unintended regression.

Reviews (1): Last reviewed commit: "feat(experimental): normalize emails dur..." | Re-trigger Greptile

@ping-maxwell
ping-maxwell merged commit fb4c9be into better-auth:experimental Sep 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant