spree_auth_devise 4.4.2 → 4.6.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +14 -73
  3. data/Gemfile +8 -1
  4. data/README.md +5 -11
  5. data/config/initializers/devise.rb +1 -1
  6. data/config/routes.rb +47 -45
  7. data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +1 -1
  8. data/lib/controllers/backend/spree/{admin → auth/admin}/base_controller_decorator.rb +2 -2
  9. data/lib/controllers/backend/spree/{admin → auth/admin}/orders/customer_details_controller_decorator.rb +2 -2
  10. data/lib/controllers/backend/spree/{admin → auth/admin}/orders_controller_decorator.rb +2 -2
  11. data/lib/controllers/backend/spree/auth/admin/resource_controller_decorator.rb +6 -0
  12. data/lib/controllers/frontend/spree/{checkout_controller_decorator.rb → auth/checkout_controller_decorator.rb} +4 -4
  13. data/lib/controllers/frontend/spree/user_passwords_controller.rb +2 -2
  14. data/lib/controllers/frontend/spree/user_registrations_controller.rb +5 -3
  15. data/lib/controllers/frontend/spree/user_sessions_controller.rb +2 -2
  16. data/lib/controllers/frontend/spree/users_controller.rb +2 -2
  17. data/lib/mailers/spree/user_mailer.rb +38 -0
  18. data/lib/spree/auth/configuration.rb +33 -0
  19. data/lib/spree/auth/engine.rb +14 -3
  20. data/lib/spree/auth/version.rb +1 -1
  21. data/lib/spree/authentication_helpers.rb +6 -6
  22. data/lib/spree/testing_support/auth_helpers.rb +8 -0
  23. data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +17 -15
  24. data/lib/views/backend/spree/admin/user_passwords/new.html.erb +13 -13
  25. data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +1 -1
  26. data/lib/views/backend/spree/admin/user_sessions/new.html.erb +8 -9
  27. data/lib/views/backend/spree/layouts/login.html.erb +1 -1
  28. data/lib/views/frontend/spree/user_registrations/new.html.erb +1 -1
  29. data/spec/controllers/spree/api/v2/storefront/passwords_controller_spec.rb +2 -2
  30. data/spec/controllers/spree/checkout_controller_spec.rb +34 -2
  31. data/spec/controllers/spree/products_controller_spec.rb +1 -0
  32. data/spec/controllers/spree/user_registrations_controller_spec.rb +44 -0
  33. data/spec/controllers/spree/user_sessions_controller_spec.rb +18 -0
  34. data/spec/controllers/spree/users_controller_spec.rb +39 -5
  35. data/spec/features/account_spec.rb +1 -0
  36. data/spec/features/admin/sign_in_spec.rb +20 -1
  37. data/spec/features/checkout_spec.rb +5 -4
  38. data/spec/features/confirmation_spec.rb +1 -1
  39. data/spec/features/sign_in_spec.rb +2 -2
  40. data/spec/mailers/user_mailer_spec.rb +3 -3
  41. data/spec/models/user_spec.rb +3 -3
  42. data/spec/support/configuration_helpers.rb +1 -1
  43. data/spec/support/confirm_helpers.rb +3 -1
  44. data/spree_auth_devise.gemspec +1 -1
  45. metadata +18 -18
  46. data/app/mailers/spree/user_mailer.rb +0 -23
  47. data/app/models/spree/auth_configuration.rb +0 -8
  48. data/lib/controllers/backend/spree/admin/resource_controller_decorator.rb +0 -6
  49. /data/{app/views → lib/views/emails}/spree/user_mailer/confirmation_instructions.html.erb +0 -0
  50. /data/{app/views → lib/views/emails}/spree/user_mailer/confirmation_instructions.text.erb +0 -0
  51. /data/{app/views → lib/views/emails}/spree/user_mailer/reset_password_instructions.html.erb +0 -0
  52. /data/{app/views → lib/views/emails}/spree/user_mailer/reset_password_instructions.text.erb +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_auth_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.2
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-03 00:00:00.000000000 Z
12
+ date: 2023-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 4.3.0.rc1
48
+ version: 4.5.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 4.3.0.rc1
55
+ version: 4.5.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: spree_extension
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -102,13 +102,7 @@ files:
102
102
  - app/controllers/metal_decorator.rb
103
103
  - app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
104
104
  - app/controllers/spree/api/v2/storefront/passwords_controller.rb
105
- - app/mailers/spree/user_mailer.rb
106
- - app/models/spree/auth_configuration.rb
107
105
  - app/models/spree/user.rb
108
- - app/views/spree/user_mailer/confirmation_instructions.html.erb
109
- - app/views/spree/user_mailer/confirmation_instructions.text.erb
110
- - app/views/spree/user_mailer/reset_password_instructions.html.erb
111
- - app/views/spree/user_mailer/reset_password_instructions.text.erb
112
106
  - bin/rails
113
107
  - config.ru
114
108
  - config/initializers/devise.rb
@@ -136,13 +130,13 @@ files:
136
130
  - db/migrate/20150416152553_add_missing_indices_on_user.rb
137
131
  - db/migrate/20210728103922_change_type_of_ship_address_id_and_bill_address_id_for_spree_users.rb
138
132
  - db/seeds.rb
139
- - lib/controllers/backend/spree/admin/base_controller_decorator.rb
140
- - lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
141
- - lib/controllers/backend/spree/admin/orders_controller_decorator.rb
142
- - lib/controllers/backend/spree/admin/resource_controller_decorator.rb
143
133
  - lib/controllers/backend/spree/admin/user_passwords_controller.rb
144
134
  - lib/controllers/backend/spree/admin/user_sessions_controller.rb
145
- - lib/controllers/frontend/spree/checkout_controller_decorator.rb
135
+ - lib/controllers/backend/spree/auth/admin/base_controller_decorator.rb
136
+ - lib/controllers/backend/spree/auth/admin/orders/customer_details_controller_decorator.rb
137
+ - lib/controllers/backend/spree/auth/admin/orders_controller_decorator.rb
138
+ - lib/controllers/backend/spree/auth/admin/resource_controller_decorator.rb
139
+ - lib/controllers/frontend/spree/auth/checkout_controller_decorator.rb
146
140
  - lib/controllers/frontend/spree/user_confirmations_controller.rb
147
141
  - lib/controllers/frontend/spree/user_passwords_controller.rb
148
142
  - lib/controllers/frontend/spree/user_registrations_controller.rb
@@ -150,7 +144,9 @@ files:
150
144
  - lib/controllers/frontend/spree/users_controller.rb
151
145
  - lib/generators/spree/auth/install/install_generator.rb
152
146
  - lib/generators/spree/auth/install/templates/config/initializers/devise.rb
147
+ - lib/mailers/spree/user_mailer.rb
153
148
  - lib/spree/auth.rb
149
+ - lib/spree/auth/configuration.rb
154
150
  - lib/spree/auth/devise.rb
155
151
  - lib/spree/auth/engine.rb
156
152
  - lib/spree/auth/version.rb
@@ -165,6 +161,10 @@ files:
165
161
  - lib/views/backend/spree/admin/user_sessions/new.html.erb
166
162
  - lib/views/backend/spree/layouts/admin/_login_nav.html.erb
167
163
  - lib/views/backend/spree/layouts/login.html.erb
164
+ - lib/views/emails/spree/user_mailer/confirmation_instructions.html.erb
165
+ - lib/views/emails/spree/user_mailer/confirmation_instructions.text.erb
166
+ - lib/views/emails/spree/user_mailer/reset_password_instructions.html.erb
167
+ - lib/views/emails/spree/user_mailer/reset_password_instructions.text.erb
168
168
  - lib/views/frontend/spree/shared/_flashes.html.erb
169
169
  - lib/views/frontend/spree/shared/_login_bar.html.erb
170
170
  - lib/views/frontend/spree/user_passwords/edit.html.erb
@@ -213,9 +213,9 @@ licenses:
213
213
  - BSD-3-Clause
214
214
  metadata:
215
215
  bug_tracker_uri: https://github.com/spree/spree_auth_devise/issues
216
- changelog_uri: https://github.com/spree/spree_auth_devise/releases/tag/v4.4.2
216
+ changelog_uri: https://github.com/spree/spree_auth_devise/releases/tag/v4.6.0
217
217
  documentation_uri: https://guides.spreecommerce.org/
218
- source_code_uri: https://github.com/spree/spree_auth_devise/tree/v4.4.2
218
+ source_code_uri: https://github.com/spree/spree_auth_devise/tree/v4.6.0
219
219
  post_install_message:
220
220
  rdoc_options: []
221
221
  require_paths:
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  requirements:
234
234
  - none
235
- rubygems_version: 3.2.22
235
+ rubygems_version: 3.4.1
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: Provides authentication and authorization services for use with Spree by
@@ -1,23 +0,0 @@
1
- module Spree
2
- class UserMailer < defined?(Spree::BaseMailer) ? Spree::BaseMailer : ActionMailer::Base
3
- def reset_password_instructions(user, token, *_args)
4
- current_store_id = _args.inject(:merge)[:current_store_id]
5
- @current_store = Spree::Store.find(current_store_id) || Spree::Store.current
6
- @locale = @current_store.has_attribute?(:default_locale) ? @current_store.default_locale : I18n.default_locale
7
- I18n.locale = @locale if @locale.present?
8
- @edit_password_reset_url = spree.edit_spree_user_password_url(reset_password_token: token, host: @current_store.url)
9
- @user = user
10
-
11
- mail to: user.email, from: @current_store.mail_from_address, subject: @current_store.name + ' ' + I18n.t(:subject, scope: [:devise, :mailer, :reset_password_instructions]), store_url: @current_store.url
12
- end
13
-
14
- def confirmation_instructions(user, token, _opts = {})
15
- current_store_id = _opts[:current_store_id]
16
- @current_store = Spree::Store.find(current_store_id) || Spree::Store.current
17
- @confirmation_url = spree.confirmation_url(confirmation_token: token, host: Spree::Store.current.url)
18
- @email = user.email
19
-
20
- mail to: user.email, from: @current_store.mail_from_address, subject: @current_store.name + ' ' + I18n.t(:subject, scope: [:devise, :mailer, :confirmation_instructions]), store_url: @current_store.url
21
- end
22
- end
23
- end
@@ -1,8 +0,0 @@
1
- module Spree
2
- class AuthConfiguration < Preferences::Configuration
3
- preference :registration_step, :boolean, default: true
4
- preference :signout_after_password_change, :boolean, default: true
5
- preference :confirmable, :boolean, default: false
6
- preference :validatable, :boolean, default: true
7
- end
8
- end
@@ -1,6 +0,0 @@
1
- module Spree::Admin::ResourceControllerDecorator
2
- def self.prepended(base)
3
- base.rescue_from CanCan::AccessDenied, with: :unauthorized
4
- end
5
- end
6
- Spree::Admin::ResourceController.prepend(Spree::Admin::ResourceControllerDecorator)