rails_jwt_auth 1.7.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +188 -89
- 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 +27 -9
- data/app/controllers/rails_jwt_auth/profiles_controller.rb +51 -0
- data/app/controllers/rails_jwt_auth/reset_passwords_controller.rb +65 -0
- data/app/controllers/rails_jwt_auth/sessions_controller.rb +7 -22
- 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 +60 -19
- data/app/models/concerns/rails_jwt_auth/confirmable.rb +49 -39
- data/app/models/concerns/rails_jwt_auth/invitable.rb +46 -72
- data/app/models/concerns/rails_jwt_auth/lockable.rb +38 -46
- data/app/models/concerns/rails_jwt_auth/recoverable.rb +27 -26
- 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 +46 -47
- data/lib/rails_jwt_auth/jwt_manager.rb +2 -4
- data/lib/rails_jwt_auth/session.rb +128 -0
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +11 -15
- 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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
@@ -45,9 +45,6 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '5.0'
|
48
|
-
- - "<"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '6.1'
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,9 +52,6 @@ dependencies:
|
|
55
52
|
- - ">="
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '5.0'
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '6.1'
|
61
55
|
description: Rails-API authentication solution based on JWT and inspired by Devise.
|
62
56
|
email:
|
63
57
|
- rjurado@openmailbox.org
|
@@ -73,10 +67,11 @@ files:
|
|
73
67
|
- app/controllers/concerns/rails_jwt_auth/render_helper.rb
|
74
68
|
- app/controllers/rails_jwt_auth/confirmations_controller.rb
|
75
69
|
- app/controllers/rails_jwt_auth/invitations_controller.rb
|
76
|
-
- app/controllers/rails_jwt_auth/
|
70
|
+
- app/controllers/rails_jwt_auth/profiles_controller.rb
|
77
71
|
- app/controllers/rails_jwt_auth/registrations_controller.rb
|
72
|
+
- app/controllers/rails_jwt_auth/reset_passwords_controller.rb
|
78
73
|
- app/controllers/rails_jwt_auth/sessions_controller.rb
|
79
|
-
- app/controllers/rails_jwt_auth/
|
74
|
+
- app/controllers/rails_jwt_auth/unlock_accounts_controller.rb
|
80
75
|
- app/controllers/unauthorized_controller.rb
|
81
76
|
- app/mailers/rails_jwt_auth/mailer.rb
|
82
77
|
- app/models/concerns/rails_jwt_auth/authenticatable.rb
|
@@ -86,11 +81,11 @@ files:
|
|
86
81
|
- app/models/concerns/rails_jwt_auth/recoverable.rb
|
87
82
|
- app/models/concerns/rails_jwt_auth/trackable.rb
|
88
83
|
- app/views/rails_jwt_auth/mailer/confirmation_instructions.html.erb
|
89
|
-
- app/views/rails_jwt_auth/mailer/
|
84
|
+
- app/views/rails_jwt_auth/mailer/email_change_requested_notification.html.erb
|
85
|
+
- app/views/rails_jwt_auth/mailer/invitation_instructions.html.erb
|
86
|
+
- app/views/rails_jwt_auth/mailer/password_changed_notification.html.erb
|
90
87
|
- app/views/rails_jwt_auth/mailer/reset_password_instructions.html.erb
|
91
|
-
- app/views/rails_jwt_auth/mailer/
|
92
|
-
- app/views/rails_jwt_auth/mailer/send_unlock_instructions.html.erb
|
93
|
-
- app/views/rails_jwt_auth/mailer/set_password_instructions.html.erb
|
88
|
+
- app/views/rails_jwt_auth/mailer/unlock_instructions.html.erb
|
94
89
|
- config/locales/en.yml
|
95
90
|
- lib/generators/rails_jwt_auth/install_generator.rb
|
96
91
|
- lib/generators/rails_jwt_auth/migrate_generator.rb
|
@@ -99,6 +94,7 @@ files:
|
|
99
94
|
- lib/rails_jwt_auth.rb
|
100
95
|
- lib/rails_jwt_auth/engine.rb
|
101
96
|
- lib/rails_jwt_auth/jwt_manager.rb
|
97
|
+
- lib/rails_jwt_auth/session.rb
|
102
98
|
- lib/rails_jwt_auth/spec_helpers.rb
|
103
99
|
- lib/rails_jwt_auth/version.rb
|
104
100
|
homepage: https://github.com/rjurado01/rails_jwt_auth
|
@@ -120,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
116
|
- !ruby/object:Gem::Version
|
121
117
|
version: '0'
|
122
118
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.1.4
|
124
120
|
signing_key:
|
125
121
|
specification_version: 4
|
126
122
|
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
|