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 +4 -4
- data/lib/devise_zxcvbn/model.rb +7 -2
- data/lib/devise_zxcvbn/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54eed67885d449ff837663ea9dcb2bfacd56f1d2
|
4
|
+
data.tar.gz: 11633362838425d32cb6668ba2534d7e44031415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77da9d1957a0452387dad155aeac277b9bc66cfaa592b6a3a339b4992c98bee2ce627e2caa5d3d9adad18f8ba2f473708ffb3c92a27b13db9929e0cbae4c4aa7
|
7
|
+
data.tar.gz: 996e0ad65765cee91cb3ee14f459dd2d0d480a37c13c5ed97b6a987ac4bbe2a192929691c26f0ed042462ee4dc8d330dca69c0c974b860e8ab4a028055781eac
|
data/lib/devise_zxcvbn/model.rb
CHANGED
@@ -14,7 +14,12 @@ module Devise
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def not_weak_password
|
17
|
-
weak_words =
|
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
|
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.
|
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-
|
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:
|