Skip to main content

Module validations

Module validations 

Source
Expand description

validatable module — email format + password length checks on registration (the Devise validatable analogue). Gated at runtime by auth.modules.

Functions§

validate_email
A conservative email format check (local@domain, a dot in the domain, no whitespace). Returns a AuthError::Validation on failure.
validate_password_length
Enforce a minimum password length.
validate_registration
Validate an email/password pair for registration when the validatable module is enabled. A no-op when auth state isn’t initialised (unit tests) or the module is disabled, so callers can invoke it unconditionally.