authentication-zero 2.12.3 → 2.12.4

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
  SHA256:
3
- metadata.gz: 7fb2db79d9ec8af38e73e00fd45298471a60166395b9cc28be6483f3ce2b5c19
4
- data.tar.gz: 2c9e5f9286e11bcc1a60871c2a22e46f0e82d16269142b587d109b8d3462bb7c
3
+ metadata.gz: e153855bfc24252626eb9ccb0381fadf99eda55f66db6d80081de90ea07eede5
4
+ data.tar.gz: a0fe741b9b4c073401fea77218fcfb2b7665041a073655bce689d0b84f5ee6ca
5
5
  SHA512:
6
- metadata.gz: 4ffd4716ca5ae698dd51ab43a3721c33a425c27318f517f6fe8d0f4a6799313af37618cdce3fdb03ee7d1065898fb1ae9fde4652bf7f2fab482c4e81699a0317
7
- data.tar.gz: 53fb29f4bad9fb1f59c32b5b6bcbff68427297685635c5d09217b1a3a5fe6a1fff91f392104579a3e596d6fcfb055c5c950da56eca0fd0ddedc9a8f13955e58d
6
+ metadata.gz: 661fa249b995fd6c7e0076a480597c972178a9f05231ff271fc4ecd6e24916f7d0eda5a428d4e4251c2fc0c29de6ea4b8c902f1f3665557bf15e6e2aa5897533
7
+ data.tar.gz: 699dc8d96580ba018fd238ff843ceed4d07a0b623f7b3dedd8ec88db2a2fa886025f26e8b5d526a817c0209d80db9a2b0bca0bdcb8c5f3122d10017d45e0b6f0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.12.3)
4
+ authentication-zero (2.12.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.12.3"
2
+ VERSION = "2.12.4"
3
3
  end
@@ -9,17 +9,14 @@ class User < ApplicationRecord
9
9
  kredis_string :verification_code, expires_in: 2.days
10
10
  <%- end -%>
11
11
 
12
- validates :email, presence: true, uniqueness: true
13
- validates_format_of :email, with: /\A[^@\s]+@[^@\s]+\z/
14
-
15
- validates_length_of :password, minimum: 12, allow_nil: true
16
- validates_format_of :password, with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/, allow_nil: true, message: "might easily be guessed"
12
+ validates :email, presence: true, uniqueness: true, format: { with: URI::MailTo::EMAIL_REGEXP }
13
+ validates :password, allow_nil: true, length: { minimum: 12 }, format: { with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ }
17
14
  <%- if options.pwned? -%>
18
15
  validates :password, not_pwned: { message: "might easily be guessed" }
19
16
  <%- end -%>
20
17
 
21
18
  before_validation do
22
- self.email = email.downcase.strip
19
+ self.email = email.try(:downcase).try(:strip)
23
20
  end
24
21
 
25
22
  before_validation if: :email_changed? do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.3
4
+ version: 2.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-14 00:00:00.000000000 Z
11
+ date: 2022-04-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: