Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearance::User email validation strict_mode: true option has no effect #953

Open
lulessa opened this issue Dec 8, 2021 · 1 comment
Open

Comments

@lulessa
Copy link

lulessa commented Dec 8, 2021

The Clearance::User email validation strict_mode: true option has not had any effect since strict_mode: true option was deprecated (and removed) in email_validator v2.0.0.

Strict validation was reintroduced as mode: :strict in email_validator v2.2.0

The email_validator gem was updated in clearance 793d8ad (v2.1.0).

Our app's test suite caught it when we upgraded from clearance v1.16 to v2.5 by unit testing that invalid@example (no fqdn) was expected to be an invalid email.

Proposed solutions (choose one):

  1. Restore the strict validation behavior: up the email_validator version minimum to ~> 2.2 and change strict_mode: true to mode: :strict.
  2. Or, keep the current clearance behavior as of v2.5.0 (non-strict validation) and remove strict_mode: true from email validation, since it's dead code.

Whether we keep strict validation or not, we should update clearance's test suite to check for the desired effect.

I'd be happy to open a PR, but need a decision on which solution to implement.

@foucist
Copy link
Contributor

foucist commented Apr 19, 2022

I also stumbled across this issue. I feel like choice 1. makes the most sense, change to mode: strict

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

No branches or pull requests

2 participants