Sha256: 53febb03cc21f96645c83d6987eb43d3e075661f1f11b1a168490f925064da92

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

require "devise_zxcvbn/version"
require "devise"
require "zxcvbn"

module Devise

  @@min_password_score = 4

  def self.min_password_score
    @@min_password_score
  end
    
  def self.min_password_score=(score)
    if (0..4).include?(score)
      if score < 3
        ::Rails.logger.warn "[devise_zxcvbn] A score of less than 3 is not recommended." 
      end
      @@min_password_score = score
    else
      raise "The min_password_score must be an integer and between 0..4"
    end
  end
end

Devise.add_module :zxcvbnable, :model => "devise_zxcvbn/model"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise_zxcvbn-1.1.2 lib/devise_zxcvbn.rb