rails_jwt_auth 1.6.1 → 2.0.1

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +187 -88
  3. data/app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb +15 -7
  4. data/app/controllers/concerns/rails_jwt_auth/params_helper.rb +18 -4
  5. data/app/controllers/concerns/rails_jwt_auth/render_helper.rb +10 -2
  6. data/app/controllers/rails_jwt_auth/confirmations_controller.rb +48 -10
  7. data/app/controllers/rails_jwt_auth/invitations_controller.rb +26 -9
  8. data/app/controllers/rails_jwt_auth/profiles_controller.rb +50 -0
  9. data/app/controllers/rails_jwt_auth/reset_passwords_controller.rb +65 -0
  10. data/app/controllers/rails_jwt_auth/sessions_controller.rb +5 -21
  11. data/app/controllers/rails_jwt_auth/{unlocks_controller.rb → unlock_accounts_controller.rb} +2 -2
  12. data/app/mailers/rails_jwt_auth/mailer.rb +29 -42
  13. data/app/models/concerns/rails_jwt_auth/authenticatable.rb +60 -19
  14. data/app/models/concerns/rails_jwt_auth/confirmable.rb +52 -33
  15. data/app/models/concerns/rails_jwt_auth/invitable.rb +42 -78
  16. data/app/models/concerns/rails_jwt_auth/lockable.rb +28 -46
  17. data/app/models/concerns/rails_jwt_auth/recoverable.rb +21 -31
  18. data/app/models/concerns/rails_jwt_auth/trackable.rb +13 -2
  19. data/app/views/rails_jwt_auth/mailer/confirmation_instructions.html.erb +1 -1
  20. data/app/views/rails_jwt_auth/mailer/{email_changed.html.erb → email_change_requested_notification.html.erb} +0 -0
  21. data/app/views/rails_jwt_auth/mailer/{send_invitation.html.erb → invitation_instructions.html.erb} +1 -1
  22. data/app/views/rails_jwt_auth/mailer/password_changed_notification.html.erb +3 -0
  23. data/app/views/rails_jwt_auth/mailer/reset_password_instructions.html.erb +1 -1
  24. data/app/views/rails_jwt_auth/mailer/{send_unlock_instructions.html.erb → unlock_instructions.html.erb} +1 -1
  25. data/config/locales/en.yml +6 -6
  26. data/lib/generators/rails_jwt_auth/install_generator.rb +11 -3
  27. data/lib/generators/templates/initializer.rb +43 -29
  28. data/lib/generators/templates/migration.rb +2 -1
  29. data/lib/rails_jwt_auth.rb +48 -45
  30. data/lib/rails_jwt_auth/jwt_manager.rb +2 -4
  31. data/lib/rails_jwt_auth/session.rb +132 -0
  32. data/lib/rails_jwt_auth/version.rb +1 -1
  33. metadata +10 -8
  34. data/app/controllers/rails_jwt_auth/passwords_controller.rb +0 -32
  35. data/app/views/rails_jwt_auth/mailer/set_password_instructions.html.erb +0 -5
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '1.6.1'
2
+ VERSION = '2.0.1'
3
3
  end
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: 1.6.1
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rjurado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -73,10 +73,11 @@ files:
73
73
  - app/controllers/concerns/rails_jwt_auth/render_helper.rb
74
74
  - app/controllers/rails_jwt_auth/confirmations_controller.rb
75
75
  - app/controllers/rails_jwt_auth/invitations_controller.rb
76
- - app/controllers/rails_jwt_auth/passwords_controller.rb
76
+ - app/controllers/rails_jwt_auth/profiles_controller.rb
77
77
  - app/controllers/rails_jwt_auth/registrations_controller.rb
78
+ - app/controllers/rails_jwt_auth/reset_passwords_controller.rb
78
79
  - app/controllers/rails_jwt_auth/sessions_controller.rb
79
- - app/controllers/rails_jwt_auth/unlocks_controller.rb
80
+ - app/controllers/rails_jwt_auth/unlock_accounts_controller.rb
80
81
  - app/controllers/unauthorized_controller.rb
81
82
  - app/mailers/rails_jwt_auth/mailer.rb
82
83
  - app/models/concerns/rails_jwt_auth/authenticatable.rb
@@ -86,11 +87,11 @@ files:
86
87
  - app/models/concerns/rails_jwt_auth/recoverable.rb
87
88
  - app/models/concerns/rails_jwt_auth/trackable.rb
88
89
  - app/views/rails_jwt_auth/mailer/confirmation_instructions.html.erb
89
- - app/views/rails_jwt_auth/mailer/email_changed.html.erb
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
90
93
  - app/views/rails_jwt_auth/mailer/reset_password_instructions.html.erb
91
- - app/views/rails_jwt_auth/mailer/send_invitation.html.erb
92
- - app/views/rails_jwt_auth/mailer/send_unlock_instructions.html.erb
93
- - app/views/rails_jwt_auth/mailer/set_password_instructions.html.erb
94
+ - app/views/rails_jwt_auth/mailer/unlock_instructions.html.erb
94
95
  - config/locales/en.yml
95
96
  - lib/generators/rails_jwt_auth/install_generator.rb
96
97
  - lib/generators/rails_jwt_auth/migrate_generator.rb
@@ -99,6 +100,7 @@ files:
99
100
  - lib/rails_jwt_auth.rb
100
101
  - lib/rails_jwt_auth/engine.rb
101
102
  - lib/rails_jwt_auth/jwt_manager.rb
103
+ - lib/rails_jwt_auth/session.rb
102
104
  - lib/rails_jwt_auth/spec_helpers.rb
103
105
  - lib/rails_jwt_auth/version.rb
104
106
  homepage: https://github.com/rjurado01/rails_jwt_auth
@@ -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
@@ -1,5 +0,0 @@
1
- <p>Hello <%= @user[RailsJwtAuth.email_field_name] %>!</p>
2
-
3
- <p>You need to define your password to complete registration. You can do this through the link below.</p>
4
-
5
- <p><%= link_to 'Set my password', @reset_passwords_url.html_safe %></p>