minimalist_authentication 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8a2b2b5886441bd2caccf120684993ea44b9025d
4
- data.tar.gz: 1b899289e1c6a5ce92a9f7a19701b8b420dc4d58
2
+ SHA256:
3
+ metadata.gz: 7a2486a7a8ebc10d0d26d0d91086b3897ab00cd9b5ab7a8536d4446158fb814f
4
+ data.tar.gz: d947bf6cd11550149928753b2deb7bef9d6d6b86ce77519ed4aa26e7fd0dcca7
5
5
  SHA512:
6
- metadata.gz: abbc5c340ff367814b579e35258399e8a39140f93bb5bb626b2a6b31d91bfe4affc34ece7c8e0c94c1e818582a410edab48e448762073a970a0adbbdde2d51d0
7
- data.tar.gz: fdea14e0860ae7708841d2167ec170d9bbea4730395349d68056f741c1c29b69e40684aa451d0220a1425f3c1b6e51ea151f3148ee5ed4ffc63ec2e5e692e04d
6
+ metadata.gz: b563bfa903c84aeecf8ca548b3c0f82782916b2d73f3ab323ebec38436dc233b2e5f3417fb4f017b3eecfe776478ff976b79ed7bee1e379766acac6f02f5e85a
7
+ data.tar.gz: 89f97497d4d358311f4a80cc83fa5a6cc31ddcaebf4719576f5ce563eb0b28d9c0a590ede7094b1fe79df7945a51735bedd7d15ee5369c2fb8c0052bc46ac341
data/README.md CHANGED
@@ -119,7 +119,7 @@ end
119
119
 
120
120
  Add the **email_verified_at** column to your user model:
121
121
  ```bash
122
- bin/rails generate migration AddVerificationTokenToUsers verification_token:string:uniq verification_token_generated_at:datetime
122
+ bin/rails generate migration AddEmailVerifiedAtToUsers email_verified_at:datetime
123
123
  ```
124
124
 
125
125
 
@@ -147,4 +147,4 @@ When the conversion is complete the **crypted_password**, **salt**, and
147
147
 
148
148
 
149
149
  ## License
150
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
150
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT)..
@@ -3,7 +3,7 @@ class EmailsController < ApplicationController
3
3
  end
4
4
 
5
5
  def update
6
- if current_user.update_attributes(user_params)
6
+ if current_user.update(user_params)
7
7
  redirect_to update_redirect_path, notice: 'Email successfully updated'
8
8
  else
9
9
  render :edit
@@ -21,7 +21,7 @@ class PasswordsController < ApplicationController
21
21
  private
22
22
 
23
23
  def user
24
- @user ||= User.find(params[:user_id])
24
+ @user ||= MinimalistAuthentication.configuration.user_model.find(params[:user_id])
25
25
  end
26
26
 
27
27
  def token
@@ -3,8 +3,8 @@ module MinimalistAuthentication
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- skip_before_action :authorization_required, only: %i(new create)
7
- skip_before_action :verify_authenticity_token, only: %i(create destroy)
6
+ skip_before_action :authorization_required, only: %i(new create)
7
+ before_action :redirect_logged_in_users, only: :new
8
8
  end
9
9
 
10
10
  def new
@@ -53,6 +53,11 @@ module MinimalistAuthentication
53
53
  end
54
54
  end
55
55
 
56
+ def redirect_logged_in_users
57
+ redirect_to(login_redirect_to) if logged_in?
58
+ end
59
+
60
+
56
61
  def after_authentication_success
57
62
  redirect_back_or_default(login_redirect_to)
58
63
  end
@@ -69,7 +74,7 @@ module MinimalistAuthentication
69
74
  end
70
75
 
71
76
  def scrub_session!
72
- (session.keys - %w(session_id _csrf_token return_to)).each do |key|
77
+ (session.keys - %w(session_id return_to)).each do |key|
73
78
  session.delete(key)
74
79
  end
75
80
  end
@@ -19,7 +19,7 @@ module MinimalistAuthentication
19
19
  end
20
20
 
21
21
  def matches_verification_token?(token)
22
- verification_token_valid? && secure_match?(token)
22
+ token.present? && verification_token_valid? && secure_match?(token)
23
23
  end
24
24
 
25
25
  def verification_token_valid?
@@ -1,3 +1,3 @@
1
1
  module MinimalistAuthentication
2
- VERSION = '2.1.1'
2
+ VERSION = '2.2.0'
3
3
  end
metadata CHANGED
@@ -1,28 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimalist_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Baldwin
8
8
  - Brightways Learning
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-16 00:00:00.000000000 Z
12
+ date: 2020-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '5.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '5.0'
28
28
  - !ruby/object:Gem::Dependency
@@ -46,19 +46,33 @@ dependencies:
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.1.3
48
48
  - !ruby/object:Gem::Dependency
49
- name: sqlite3
49
+ name: loofah
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
54
+ version: 2.3.1
55
+ type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 2.3.1
62
+ - !ruby/object:Gem::Dependency
63
+ name: sqlite3
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
62
76
  description: A Rails authentication plugin that takes a minimalist approach. It is
63
77
  designed to be simple to understand, use, and modify for your application.
64
78
  email:
@@ -110,7 +124,7 @@ homepage: https://github.com/wwidea/minimalist_authentication
110
124
  licenses:
111
125
  - MIT
112
126
  metadata: {}
113
- post_install_message:
127
+ post_install_message:
114
128
  rdoc_options: []
115
129
  require_paths:
116
130
  - lib
@@ -125,9 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  - !ruby/object:Gem::Version
126
140
  version: '0'
127
141
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.6.13
130
- signing_key:
142
+ rubygems_version: 3.1.2
143
+ signing_key:
131
144
  specification_version: 4
132
145
  summary: A Rails authentication plugin that takes a minimalist approach.
133
146
  test_files: []