Skip to content

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

@lulessa

Description

@lulessa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions