minimalist_authentication 2.2.3 → 2.2.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: cda06c345d4fa37142558f9d0dbeaf836214efebc30d05d0a048fbe914ded344
4
- data.tar.gz: 462cc4702b9a9c5d2c6311743faeb22647da2900cea5650908641026635e9fdf
3
+ metadata.gz: b86110ca5e209864047e3c499a09401a264019ea2bd4311d3eb11e02ac95c29c
4
+ data.tar.gz: '0493e05bb52e0090890c785149bfb237309b2ad6e81988258f5fda308f8bf8bf'
5
5
  SHA512:
6
- metadata.gz: 22ee36a9560fff58c576faa9e11d5a17ebfdd920b84a64c2673affe0a0abe39c98d256aaaf261e988e8c720a3a420984658a92073050520345974bb888421851
7
- data.tar.gz: 11150ad09e46ef906e1d5b2f47172b33a8608867f4e5686d5c9d63636155be3eff0eb16509d74a8dccdd3da98c2e5985a9bf40c253f463762a0d44dd9d0072be
6
+ metadata.gz: eade9a93179f92c337ed21258d438861fbe70210d1a252dab6998fe10f49d18e0b6ddf250bef8bc6ebae69aa068e44bf00e366d4aeae4e9c4c55775402c21a8f
7
+ data.tar.gz: b1fcc6eb5d0dcd5bfcb8e1e740a72faff20c397f8ed9bc216a0eba343cddbd36457e2bf03aa09ec1fee51c6f82f429c97b7dfc6becdf4562b555d744074f5d21
@@ -5,7 +5,6 @@ module MinimalistAuthentication
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  GUEST_USER_EMAIL = 'guest'
8
- EMAIL_REGEX = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
9
8
  PASSWORD_MIN = 8
10
9
  PASSWORD_MAX = 40
11
10
 
@@ -20,14 +19,22 @@ module MinimalistAuthentication
20
19
  before_save :hash_password
21
20
 
22
21
  # Email validations
23
- validates_presence_of :email, if: :validate_email_presence?
24
- validates_uniqueness_of :email, allow_blank: true, case_sensitive: false, if: :validate_email?
25
- validates_format_of :email, allow_blank: true, with: EMAIL_REGEX, if: :validate_email?
22
+ validates(
23
+ :email,
24
+ format: { allow_blank: true, with: URI::MailTo::EMAIL_REGEXP },
25
+ uniqueness: { allow_blank: true, case_sensitive: false, scope: :active },
26
+ if: :validate_email?
27
+ )
28
+ validates(:email, presence: true, if: :validate_email_presence?)
26
29
 
27
30
  # Password validations
28
- validates_presence_of :password, if: :validate_password?
29
- validates_confirmation_of :password, if: :validate_password?
30
- validates_length_of :password, within: PASSWORD_MIN..PASSWORD_MAX, if: :validate_password?
31
+ validates(
32
+ :password,
33
+ confirmation: true,
34
+ length: { within: PASSWORD_MIN..PASSWORD_MAX },
35
+ presence: true,
36
+ if: :validate_password?
37
+ )
31
38
 
32
39
  # Active scope
33
40
  scope :active, ->(state = true) { where(active: state) }
@@ -1,3 +1,3 @@
1
1
  module MinimalistAuthentication
2
- VERSION = '2.2.3'
2
+ VERSION = '2.2.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimalist_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Baldwin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-31 00:00:00.000000000 Z
12
+ date: 2022-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.2.26
128
+ rubygems_version: 3.3.9
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: A Rails authentication plugin that takes a minimalist approach.