devise_zxcvbn 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b185143f362c88a8d585d8398420033b0bc99f76
4
- data.tar.gz: 130c102edbda7dbabc9523033687cf4b247f5c18
3
+ metadata.gz: 54eed67885d449ff837663ea9dcb2bfacd56f1d2
4
+ data.tar.gz: 11633362838425d32cb6668ba2534d7e44031415
5
5
  SHA512:
6
- metadata.gz: 1c215fa52aeb0f5b6a9a3423568217e5d5cc7b4be20ada3c53aebc5934b85126ca3b5feafc6b6b946ee0ebcc695f4ab032b5042dd473888e302371e7c2efc2df
7
- data.tar.gz: a0dd005f8ab6e023158110b91ab240dc01b9eb9f21fd207c021d81e309082e1fbfc7f0a02f76ef4e14b88167288f7397f890e5ba652800b7ad5fc21e97e98c41
6
+ metadata.gz: 77da9d1957a0452387dad155aeac277b9bc66cfaa592b6a3a339b4992c98bee2ce627e2caa5d3d9adad18f8ba2f473708ffb3c92a27b13db9929e0cbae4c4aa7
7
+ data.tar.gz: 996e0ad65765cee91cb3ee14f459dd2d0d480a37c13c5ed97b6a987ac4bbe2a192929691c26f0ed042462ee4dc8d330dca69c0c974b860e8ab4a028055781eac
@@ -14,7 +14,12 @@ module Devise
14
14
  private
15
15
 
16
16
  def not_weak_password
17
- weak_words = [self.email] + DeviseZxcvbn::EmailTokeniser.split(self.email)
17
+ weak_words = if self.email
18
+ [self.email, *DeviseZxcvbn::EmailTokeniser.split(self.email)]
19
+ else
20
+ []
21
+ end
22
+
18
23
  password_score = ::Zxcvbn.test(password, weak_words).score
19
24
  if password_score < min_password_score
20
25
  self.errors.add :password, :weak_password, score: password_score, min_password_score: min_password_score
@@ -27,4 +32,4 @@ module Devise
27
32
  end
28
33
  end
29
34
  end
30
- end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module DeviseZxcvbn
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_zxcvbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-20 00:00:00.000000000 Z
11
+ date: 2014-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,3 +124,4 @@ specification_version: 4
124
124
  summary: Devise plugin to reject weak passwords
125
125
  test_files:
126
126
  - spec/devise_zxcvbn/email_tokeniser_spec.rb
127
+ has_rdoc: