rails_jwt_auth 1.6.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +186 -87
  3. data/app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb +15 -7
  4. data/app/controllers/concerns/rails_jwt_auth/params_helper.rb +19 -5
  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 +59 -18
  14. data/app/models/concerns/rails_jwt_auth/confirmable.rb +58 -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 +47 -45
  30. data/lib/rails_jwt_auth/jwt_manager.rb +0 -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 -28
  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.0'
2
+ VERSION = '2.0.0'
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.0
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-02-20 00:00:00.000000000 Z
11
+ date: 2020-09-14 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,28 +0,0 @@
1
- module RailsJwtAuth
2
- class PasswordsController < ApplicationController
3
- include ParamsHelper
4
- include RenderHelper
5
-
6
- def create
7
- return render_422(email: [{error: :blank}]) if password_create_params[:email].blank?
8
-
9
- user = RailsJwtAuth.model.where(
10
- email: password_create_params[:email].to_s.strip.downcase
11
- ).first
12
-
13
- return render_422(email: [{error: :not_found}]) unless user
14
-
15
- user.send_reset_password_instructions ? render_204 : render_422(user.errors.details)
16
- end
17
-
18
- def update
19
- return render_404 unless
20
- params[:id] &&
21
- (user = RailsJwtAuth.model.where(reset_password_token: params[:id]).first)
22
-
23
- return render_422(password: [{error: :blank}]) if password_update_params[:password].blank?
24
-
25
- user.update(password_update_params) ? render_204 : render_422(user.errors.details)
26
- end
27
- end
28
- 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>