rails_jwt_auth 1.7.3 → 2.0.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 +4 -4
- data/README.md +186 -87
- data/app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb +15 -7
- data/app/controllers/concerns/rails_jwt_auth/params_helper.rb +18 -4
- data/app/controllers/concerns/rails_jwt_auth/render_helper.rb +10 -2
- data/app/controllers/rails_jwt_auth/confirmations_controller.rb +48 -10
- data/app/controllers/rails_jwt_auth/invitations_controller.rb +26 -9
- data/app/controllers/rails_jwt_auth/profiles_controller.rb +50 -0
- data/app/controllers/rails_jwt_auth/reset_passwords_controller.rb +65 -0
- data/app/controllers/rails_jwt_auth/sessions_controller.rb +5 -21
- data/app/controllers/rails_jwt_auth/{unlocks_controller.rb → unlock_accounts_controller.rb} +2 -2
- data/app/mailers/rails_jwt_auth/mailer.rb +23 -28
- data/app/models/concerns/rails_jwt_auth/authenticatable.rb +59 -18
- data/app/models/concerns/rails_jwt_auth/confirmable.rb +41 -38
- data/app/models/concerns/rails_jwt_auth/invitable.rb +42 -77
- data/app/models/concerns/rails_jwt_auth/lockable.rb +28 -45
- data/app/models/concerns/rails_jwt_auth/recoverable.rb +20 -28
- data/app/models/concerns/rails_jwt_auth/trackable.rb +13 -2
- data/app/views/rails_jwt_auth/mailer/confirmation_instructions.html.erb +1 -1
- data/app/views/rails_jwt_auth/mailer/{email_changed.html.erb → email_change_requested_notification.html.erb} +0 -0
- data/app/views/rails_jwt_auth/mailer/{send_invitation.html.erb → invitation_instructions.html.erb} +1 -1
- data/app/views/rails_jwt_auth/mailer/password_changed_notification.html.erb +3 -0
- data/app/views/rails_jwt_auth/mailer/reset_password_instructions.html.erb +1 -1
- data/app/views/rails_jwt_auth/mailer/{send_unlock_instructions.html.erb → unlock_instructions.html.erb} +1 -1
- data/config/locales/en.yml +6 -6
- data/lib/generators/rails_jwt_auth/install_generator.rb +11 -3
- data/lib/generators/templates/initializer.rb +43 -29
- data/lib/generators/templates/migration.rb +2 -1
- data/lib/rails_jwt_auth.rb +44 -47
- data/lib/rails_jwt_auth/jwt_manager.rb +0 -4
- data/lib/rails_jwt_auth/session.rb +132 -0
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +17 -9
- data/app/controllers/rails_jwt_auth/passwords_controller.rb +0 -32
- data/app/views/rails_jwt_auth/mailer/set_password_instructions.html.erb +0 -5
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '5.0'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '6.1'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +55,9 @@ dependencies:
|
|
52
55
|
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '5.0'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '6.1'
|
55
61
|
description: Rails-API authentication solution based on JWT and inspired by Devise.
|
56
62
|
email:
|
57
63
|
- rjurado@openmailbox.org
|
@@ -67,10 +73,11 @@ files:
|
|
67
73
|
- app/controllers/concerns/rails_jwt_auth/render_helper.rb
|
68
74
|
- app/controllers/rails_jwt_auth/confirmations_controller.rb
|
69
75
|
- app/controllers/rails_jwt_auth/invitations_controller.rb
|
70
|
-
- app/controllers/rails_jwt_auth/
|
76
|
+
- app/controllers/rails_jwt_auth/profiles_controller.rb
|
71
77
|
- app/controllers/rails_jwt_auth/registrations_controller.rb
|
78
|
+
- app/controllers/rails_jwt_auth/reset_passwords_controller.rb
|
72
79
|
- app/controllers/rails_jwt_auth/sessions_controller.rb
|
73
|
-
- app/controllers/rails_jwt_auth/
|
80
|
+
- app/controllers/rails_jwt_auth/unlock_accounts_controller.rb
|
74
81
|
- app/controllers/unauthorized_controller.rb
|
75
82
|
- app/mailers/rails_jwt_auth/mailer.rb
|
76
83
|
- app/models/concerns/rails_jwt_auth/authenticatable.rb
|
@@ -80,11 +87,11 @@ files:
|
|
80
87
|
- app/models/concerns/rails_jwt_auth/recoverable.rb
|
81
88
|
- app/models/concerns/rails_jwt_auth/trackable.rb
|
82
89
|
- app/views/rails_jwt_auth/mailer/confirmation_instructions.html.erb
|
83
|
-
- app/views/rails_jwt_auth/mailer/
|
90
|
+
- app/views/rails_jwt_auth/mailer/email_change_requested_notification.html.erb
|
91
|
+
- app/views/rails_jwt_auth/mailer/invitation_instructions.html.erb
|
92
|
+
- app/views/rails_jwt_auth/mailer/password_changed_notification.html.erb
|
84
93
|
- app/views/rails_jwt_auth/mailer/reset_password_instructions.html.erb
|
85
|
-
- app/views/rails_jwt_auth/mailer/
|
86
|
-
- app/views/rails_jwt_auth/mailer/send_unlock_instructions.html.erb
|
87
|
-
- app/views/rails_jwt_auth/mailer/set_password_instructions.html.erb
|
94
|
+
- app/views/rails_jwt_auth/mailer/unlock_instructions.html.erb
|
88
95
|
- config/locales/en.yml
|
89
96
|
- lib/generators/rails_jwt_auth/install_generator.rb
|
90
97
|
- lib/generators/rails_jwt_auth/migrate_generator.rb
|
@@ -93,6 +100,7 @@ files:
|
|
93
100
|
- lib/rails_jwt_auth.rb
|
94
101
|
- lib/rails_jwt_auth/engine.rb
|
95
102
|
- lib/rails_jwt_auth/jwt_manager.rb
|
103
|
+
- lib/rails_jwt_auth/session.rb
|
96
104
|
- lib/rails_jwt_auth/spec_helpers.rb
|
97
105
|
- lib/rails_jwt_auth/version.rb
|
98
106
|
homepage: https://github.com/rjurado01/rails_jwt_auth
|
@@ -114,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
122
|
- !ruby/object:Gem::Version
|
115
123
|
version: '0'
|
116
124
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.0.3
|
118
126
|
signing_key:
|
119
127
|
specification_version: 4
|
120
128
|
summary: Rails jwt authentication.
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module RailsJwtAuth
|
2
|
-
class PasswordsController < ApplicationController
|
3
|
-
include ParamsHelper
|
4
|
-
include RenderHelper
|
5
|
-
|
6
|
-
def create
|
7
|
-
email_field = RailsJwtAuth.email_field_name
|
8
|
-
|
9
|
-
if password_create_params[email_field].blank?
|
10
|
-
return render_422(email_field => [{error: :blank}])
|
11
|
-
end
|
12
|
-
|
13
|
-
user = RailsJwtAuth.model.where(
|
14
|
-
email_field => password_create_params[email_field].to_s.strip.downcase
|
15
|
-
).first
|
16
|
-
|
17
|
-
return render_422(email_field => [{error: :not_found}]) unless user
|
18
|
-
|
19
|
-
user.send_reset_password_instructions ? render_204 : render_422(user.errors.details)
|
20
|
-
end
|
21
|
-
|
22
|
-
def update
|
23
|
-
return render_404 unless
|
24
|
-
params[:id] &&
|
25
|
-
(user = RailsJwtAuth.model.where(reset_password_token: params[:id]).first)
|
26
|
-
|
27
|
-
return render_422(password: [{error: :blank}]) if password_update_params[:password].blank?
|
28
|
-
|
29
|
-
user.update(password_update_params) ? render_204 : render_422(user.errors.details)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|