No commit activity in last 3 years
No release in over 3 years
validates strength of password with ActiveRecord
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

PasswordStrengthValidator

Build Status

validates strength of password with ActiveRecord

Usage

  • with default options
    • require 8 - 72 characters
    • require both uppercase and lowercase
    • require 1 or more digtis
class TestModel < ActiveRecord::Base
  validates :password, password_strength: true
end
  • add extra option for more strength
    • require 12 - 72 characters
    • require 3 or more digits
    • require 3 or more symbols
class StrongTestModel < ActiveRecord::Base
  validates :password, password_strength: { min_length: 12, number_of_digits: 3, number_of_symbols: 3 }
end
  • acceptable symbols:
!@"#$%&'()*+,-./:;<=>?[\]^_`{|}~
  • custom error message

to cusotomize error message, specify your local file with key:

#{lang}.errors.messages.weak_password

License

The gem is available as open source under the terms of the MIT License.