minimalist_authentication 2.6.0 → 2.6.2

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: d31aea6a71210e6ef2811dd5ea7d4f11654ff06cb3c5f92ace5ed00dd7d68d30
4
- data.tar.gz: 1cb2c601a6effedef5bdc61960c7e08d7947083c4f755646b92c188c50e0a96f
3
+ metadata.gz: 05b2b926522ced063d72007717f98e12af465740245ba02a61bdcc75e53a5cab
4
+ data.tar.gz: c42e2529f6211ea1c2d81958d96a4b3711173e7b7da4ac32482cb0f2b8ca3fcb
5
5
  SHA512:
6
- metadata.gz: ba68753ea4d7f106aa8c26b0972ea0d2cdc36ab5991f4ac6824fde2000603b6bae011e949d978e948ce35af00551aff8b47b943a48589f834df4242e7e889298
7
- data.tar.gz: afbcc93b12b3926d7b799267aede7ccef00ac9137f0320c0d00079035a7b81f099fda617369d445d7abea52521c32fca4317cf1a81d19022905bbe0f610bb3ab
6
+ metadata.gz: 53254b7754bcbe07608c3b779c42737eaa6243e25a86aa7df21a7cd576e9cfbb1d20c3b63470ed59e69f0a7ee659e4c0075f60b493dfd1e3c28d6e0ede1fa167
7
+ data.tar.gz: bfcd187bc8c0f4602e0040c45bdead5bd3138dc1134a173bf449bd84d37b05c7c954595831d39835c7694b35c04d87d86a746701332d52a27c8d6e6754529e4b
@@ -29,6 +29,6 @@ class PasswordResetsController < ApplicationController
29
29
  end
30
30
 
31
31
  def email
32
- params.require(:user).fetch(:email)
32
+ params.dig(:user, :email)
33
33
  end
34
34
  end
@@ -44,7 +44,7 @@ module MinimalistAuthentication
44
44
  end
45
45
 
46
46
  def user_params
47
- @user_params ||= params.require(:user).permit(:email, :username, :password)
47
+ @user_params ||= params.fetch(:user, {}).permit(:email, :username, :password)
48
48
  end
49
49
 
50
50
  def set_or_verify_email
@@ -10,10 +10,10 @@ module MinimalistAuthentication
10
10
 
11
11
  included do
12
12
  # Stores the plain text password.
13
- attr_accessor :password
13
+ attribute :password, :string
14
14
 
15
15
  # Force validations for a blank password.
16
- attr_accessor :password_required
16
+ attribute :password_required, :boolean, default: false
17
17
 
18
18
  # Hashes and stores the password on save.
19
19
  before_save :hash_password
@@ -118,7 +118,7 @@ module MinimalistAuthentication
118
118
  # stored OR are attempting to set a new password. Set **password_required**
119
119
  # to true to force validations even when the password field is blank.
120
120
  def validate_password?
121
- active? && (password_hash.blank? || password.present? || password_required)
121
+ active? && (password_hash.blank? || password? || password_required?)
122
122
  end
123
123
 
124
124
  # Validate email for active users.
@@ -15,7 +15,7 @@ module MinimalistAuthentication
15
15
  if matches_verification_token?(token)
16
16
  update(attributes) && clear_token
17
17
  else
18
- errors.add(:base, "Verfication token check failed")
18
+ errors.add(:base, "Verification token check failed")
19
19
  false
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MinimalistAuthentication
4
- VERSION = "2.6.0"
4
+ VERSION = "2.6.2"
5
5
  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.6.0
4
+ version: 2.6.2
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: 2024-07-04 00:00:00.000000000 Z
12
+ date: 2024-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bcrypt