solidus_auth_devise 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_auth_devise might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a2eba838fc8a03ef6bdf7a6d113c00c1a2c76f55fc3237e73bc6cee1dcf11f7
4
- data.tar.gz: c23c24fd0f9f60c4e60058905d46b56b31e57c4b4b307cefe688a5b1f7a6883f
3
+ metadata.gz: 3c6c2097e3d2c1eb8ab42f2041ed80caff235d27c89bae9a45f8d59942795213
4
+ data.tar.gz: 8c8bc99337a0955ed97db3bd395bce4fb6277f56696d71c02f72ec77b5533294
5
5
  SHA512:
6
- metadata.gz: 571cf2a517b9d84e73731352c36dbba9a78d0325d28ca4247b3ae221067202616f6d11a3993bbcfb621cf8f388ce7edaa938ff7bfa941bb9035027b3d4f97b39
7
- data.tar.gz: 916b836223e7d1bf6fe9872ff2616939e763d9f403c0f0148b13a16e73d58d36bbaa913c87f314fe4bf537a8ef8620dfbcb56af5693cb17a45344feaab383a2e
6
+ metadata.gz: '09fd7561bd89f6199043a5938f25f5d9d006a1e213cef45b5280e68b489744229957ea1cc7eb7d8c682015c1400d76f47f561e39eda9cf20c7d6f4071ba58fdc'
7
+ data.tar.gz: c5d6cac45f525a52ca758c97478adcacc331e099a19501d932fe73e2b3ca6cb1e7d0829fc857559a925c70d236dd6ef796cf1c4f0638e63e79728714e760ae5d
data/CHANGELOG.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # Change Log
2
2
 
3
- ## [Unreleased](https://github.com/solidusio/solidus_auth_devise/tree/HEAD)
4
-
5
- [Full Changelog](https://github.com/solidusio/solidus_auth_devise/compare/v2.2.0...HEAD)
3
+ ## [v2.3.0](https://github.com/solidusio/solidus_auth_devise/tree/v2.3.0) (2019-08-19)
4
+ [Full Changelog](https://github.com/solidusio/solidus_auth_devise/compare/v2.2.0...v2.3.0)
6
5
 
7
6
  **Closed issues:**
8
7
 
@@ -10,6 +9,7 @@
10
9
 
11
10
  **Merged pull requests:**
12
11
 
12
+ - Add GitHub changelog generator [\#168](https://github.com/solidusio/solidus_auth_devise/pull/168) ([kennyadsl](https://github.com/kennyadsl))
13
13
  - Fix CI issues [\#167](https://github.com/solidusio/solidus_auth_devise/pull/167) ([kennyadsl](https://github.com/kennyadsl))
14
14
  - Stub preferences in specs instead of resetting [\#166](https://github.com/solidusio/solidus_auth_devise/pull/166) ([kennyadsl](https://github.com/kennyadsl))
15
15
  - Add appropriate classes to admin login button [\#164](https://github.com/solidusio/solidus_auth_devise/pull/164) ([jacobeubanks](https://github.com/jacobeubanks))
@@ -17,7 +17,6 @@
17
17
  - Fix minor grammar concerns in console messages [\#162](https://github.com/solidusio/solidus_auth_devise/pull/162) ([jacobherrington](https://github.com/jacobherrington))
18
18
  - Logout with DELETE verb by default [\#161](https://github.com/solidusio/solidus_auth_devise/pull/161) ([kennyadsl](https://github.com/kennyadsl))
19
19
  - Use secret\_key\_base for Rails 6 compatibility [\#160](https://github.com/solidusio/solidus_auth_devise/pull/160) ([aldesantis](https://github.com/aldesantis))
20
- - Improve decorators [\#159](https://github.com/solidusio/solidus_auth_devise/pull/159) ([jacobherrington](https://github.com/jacobherrington))
21
20
  - Add rubocop as a development dependency [\#158](https://github.com/solidusio/solidus_auth_devise/pull/158) ([jacobherrington](https://github.com/jacobherrington))
22
21
  - Update confusing i18n translation [\#157](https://github.com/solidusio/solidus_auth_devise/pull/157) ([jacobherrington](https://github.com/jacobherrington))
23
22
  - Remove flash errors from password recovery [\#156](https://github.com/solidusio/solidus_auth_devise/pull/156) ([jacobherrington](https://github.com/jacobherrington))
@@ -39,6 +38,7 @@
39
38
 
40
39
  **Merged pull requests:**
41
40
 
41
+ - Improve decorators [\#159](https://github.com/solidusio/solidus_auth_devise/pull/159) ([jacobherrington](https://github.com/jacobherrington))
42
42
  - Add v2.2.0 CHANGELOG entries [\#153](https://github.com/solidusio/solidus_auth_devise/pull/153) ([kennyadsl](https://github.com/kennyadsl))
43
43
  - Add gem-release support [\#152](https://github.com/solidusio/solidus_auth_devise/pull/152) ([kennyadsl](https://github.com/kennyadsl))
44
44
  - Add missing pessimistic versioning [\#149](https://github.com/solidusio/solidus_auth_devise/pull/149) ([aitbw](https://github.com/aitbw))
@@ -59,7 +59,6 @@
59
59
  - Add Solidus v2.7 to .travis.yml [\#127](https://github.com/solidusio/solidus_auth_devise/pull/127) ([jacobherrington](https://github.com/jacobherrington))
60
60
  - Fix spree routes [\#125](https://github.com/solidusio/solidus_auth_devise/pull/125) ([jtapia](https://github.com/jtapia))
61
61
  - Remove unnecessary decorator [\#122](https://github.com/solidusio/solidus_auth_devise/pull/122) ([jhawthorn](https://github.com/jhawthorn))
62
- - Disable backend footer profile edit link if role cannot edit users [\#120](https://github.com/solidusio/solidus_auth_devise/pull/120) ([gianlucarizzo](https://github.com/gianlucarizzo))
63
62
 
64
63
  ## [v2.1.0](https://github.com/solidusio/solidus_auth_devise/tree/v2.1.0) (2018-01-22)
65
64
  [Full Changelog](https://github.com/solidusio/solidus_auth_devise/compare/v2.0.0...v2.1.0)
@@ -114,6 +113,7 @@
114
113
 
115
114
  **Merged pull requests:**
116
115
 
116
+ - Disable backend footer profile edit link if role cannot edit users [\#120](https://github.com/solidusio/solidus_auth_devise/pull/120) ([gianlucarizzo](https://github.com/gianlucarizzo))
117
117
  - Remove dependency on json, multi\_json [\#91](https://github.com/solidusio/solidus_auth_devise/pull/91) ([jhawthorn](https://github.com/jhawthorn))
118
118
  - Remove Unnecessary `require` statements. [\#89](https://github.com/solidusio/solidus_auth_devise/pull/89) ([stewart](https://github.com/stewart))
119
119
  - Do not require core email validator [\#87](https://github.com/solidusio/solidus_auth_devise/pull/87) ([tvdeyen](https://github.com/tvdeyen))
data/Gemfile CHANGED
@@ -5,19 +5,23 @@ source "https://rubygems.org"
5
5
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
6
6
  gem "solidus", github: "solidusio/solidus", branch: branch
7
7
 
8
- group :test do
9
- if branch == 'master' || branch >= "v2.0"
10
- gem 'rails-controller-testing', '~> 1.0'
11
- else
12
- gem "rails_test_params_backport"
13
- end
8
+ # Needed to help Bundler figure out how to resolve dependencies,
9
+ # otherwise it takes forever to resolve them
10
+ if branch == 'master' || Gem::Version.new(branch[1..-1]) >= Gem::Version.new('2.10.0')
11
+ gem 'rails', '~> 6.0'
12
+ else
13
+ gem 'rails', '~> 5.0'
14
+ end
14
15
 
15
- gem 'factory_bot', (branch < 'v2.5' ? '4.10.0' : '> 4.10.0')
16
+ group :test do
17
+ gem 'rails-controller-testing', '~> 1.0'
18
+ gem 'factory_bot', '> 4.10.0'
16
19
  end
17
20
 
18
- if ENV['DB'] == 'mysql'
21
+ case ENV['DB']
22
+ when 'mysql'
19
23
  gem 'mysql2', '~> 0.4.10'
20
- else
24
+ when 'postgres'
21
25
  gem 'pg', '~> 0.21'
22
26
  end
23
27
 
@@ -25,6 +29,4 @@ group :development, :test do
25
29
  gem 'pry-rails', '~> 0.3.9'
26
30
  end
27
31
 
28
- gem 'deface', '~> 1.3', require: false
29
-
30
32
  gemspec
@@ -0,0 +1,20 @@
1
+ <!--
2
+ insert_before "fieldset#admin_user_edit_api_key"
3
+ original "904c52ff702412d1dc8d55ff44d87d7f581f6675"
4
+ -->
5
+
6
+ <% if @user != try_spree_current_user %>
7
+ <fieldset class="no-border-bottom" data-hook="admin_user_reset_password">
8
+ <legend><%= t(:'spree.forgot_password') %></legend>
9
+
10
+ <%= form_for [:admin, @user], as: :spree_user, url: admin_reset_password_path, method: :post do |f| %>
11
+ <%= f.hidden_field :email, value: @user.email %>
12
+
13
+ <% if can?(:update, @user) %>
14
+ <div class="align-center">
15
+ <%= f.submit Spree.user_class.human_attribute_name(:reset_password), class: "button primary" %>
16
+ </div>
17
+ <% end %>
18
+ <% end %>
19
+ </fieldset>
20
+ <% end %>
@@ -1,8 +1,8 @@
1
+ ---
1
2
  it:
2
3
  spree:
3
- admin:
4
- tab:
5
- users: Utenti
4
+ admin_login: Login Amministrazione
5
+ change_my_password: Cambia la password
6
6
  devise:
7
7
  confirmations:
8
8
  confirmed: Il tuo account è stato correttamente confermato. Ora sei collegato.
@@ -65,9 +65,9 @@ it:
65
65
  signed_out: Uscito correttamente.
66
66
  errors:
67
67
  messages:
68
- email_is_invalid: L'indirizzo email non può essere vuoto
69
68
  already_confirmed: è stato già confermato
70
69
  confirmation_period_expired: deve essere confermato entro %{period}, richiedi una nuova conferma
70
+ email_is_invalid: L'indirizzo email non può essere vuoto
71
71
  expired: è scaduto, si prega di richiederne uno nuovo
72
72
  not_found: non trovato
73
73
  not_locked: non era bloccato
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Spree::Admin::Orders::CustomerDetailsController.class_eval do
4
- before_action :check_authorization
3
+ module Spree::Admin::Orders::CustomerDetailsControllerDecorator
4
+ def self.prepended(base)
5
+ base.before_action :check_authorization
6
+ end
5
7
 
6
8
  private
7
9
 
@@ -15,4 +17,6 @@ Spree::Admin::Orders::CustomerDetailsController.class_eval do
15
17
 
16
18
  authorize! action, resource, session[:access_token]
17
19
  end
20
+
21
+ Spree::Admin::Orders::CustomerDetailsController.prepend self
18
22
  end
@@ -25,7 +25,7 @@ class Spree::Admin::UserPasswordsController < Devise::PasswordsController
25
25
  set_flash_message(:notice, :send_instructions) if is_navigational_format?
26
26
 
27
27
  if resource.errors.empty?
28
- respond_with resource, location: spree.admin_login_path
28
+ respond_with resource, location: admin_user_path(resource)
29
29
  else
30
30
  respond_with_navigational(resource) { render :new }
31
31
  end
@@ -4,12 +4,4 @@ require "spree_core"
4
4
  require "solidus_support"
5
5
  require "spree/auth/devise"
6
6
  require "spree/authentication_helpers"
7
-
8
- if SolidusSupport.solidus_gem_version < Gem::Version.new('2.5.x')
9
- begin
10
- require "deface"
11
- rescue LoadError
12
- warn "deface is required to run solidus_auth_devise with solidus versions < 2.5. Please add deface to your Gemfile"
13
- raise
14
- end
15
- end
7
+ require "deface"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Spree
4
4
  module Auth
5
- VERSION = '2.3.0'
5
+ VERSION = '2.4.0'
6
6
  end
7
7
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.require_path = "lib"
22
22
  s.requirements << "none"
23
23
 
24
- solidus_version = [">= 1.2.0", "< 3"]
24
+ solidus_version = [">= 2.6", "< 3"]
25
25
 
26
26
  s.post_install_message = "
27
27
  NOTE: Rails 6 has removed secret_token in favor of secret_key_base, which was deprecated in
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.add_dependency "devise-encryptable", "0.2.0"
34
34
  s.add_dependency "solidus_core", solidus_version
35
35
  s.add_dependency "solidus_support", ">= 0.1.3"
36
+ s.add_dependency "deface", "~> 1.0"
36
37
 
37
38
  s.add_development_dependency "capybara", "~> 2.14"
38
39
  s.add_development_dependency "capybara-screenshot"
@@ -41,7 +42,7 @@ Gem::Specification.new do |s|
41
42
  s.add_development_dependency "ffaker"
42
43
  s.add_development_dependency "gem-release", "~> 2.0"
43
44
  s.add_development_dependency "github_changelog_generator", "~> 1.14"
44
- s.add_development_dependency "rspec-rails", "~> 3.3"
45
+ s.add_development_dependency "rspec-rails", "~> 4.0.0.beta2"
45
46
  s.add_development_dependency "rubocop", "~> 0.71"
46
47
  s.add_development_dependency "rubocop-performance", "~> 1.4"
47
48
  s.add_development_dependency "rubocop-rails", "~> 2.2"
@@ -51,5 +52,5 @@ Gem::Specification.new do |s|
51
52
  s.add_development_dependency "simplecov", "~> 0.14"
52
53
  s.add_development_dependency "solidus_backend", solidus_version
53
54
  s.add_development_dependency "solidus_frontend", solidus_version
54
- s.add_development_dependency "sqlite3", "~> 1.3.6"
55
+ s.add_development_dependency "sqlite3"
55
56
  end
@@ -16,13 +16,9 @@ RSpec.describe Spree::ProductsController, type: :controller do
16
16
  allow(controller).to receive(:before_save_new_order)
17
17
  allow(controller).to receive(:spree_current_user) { user }
18
18
  allow(user).to receive(:has_spree_role?) { false }
19
- if SolidusSupport.solidus_gem_version < Gem::Version.new('2.5.x')
19
+
20
+ expect {
20
21
  get :show, params: { id: product.to_param }
21
- expect(response.status).to eq(404)
22
- else
23
- expect {
24
- get :show, params: { id: product.to_param }
25
- }.to raise_error(ActiveRecord::RecordNotFound)
26
- end
22
+ }.to raise_error(ActiveRecord::RecordNotFound)
27
23
  end
28
24
  end
@@ -34,4 +34,47 @@ RSpec.feature 'Admin - Reset Password', type: :feature do
34
34
  def fill_in_email
35
35
  fill_in 'Email', with: 'foobar@example.com'
36
36
  end
37
+
38
+ context 'password management' do
39
+ let!(:admin) do
40
+ create(:admin_user,
41
+ email: 'admin@example.com',
42
+ password: 'secret',
43
+ password_confirmation: 'secret'
44
+ )
45
+ end
46
+
47
+ let!(:user) do
48
+ create(:user,
49
+ email: 'user@example.com',
50
+ password: 'test123',
51
+ password_confirmation: 'test123'
52
+ )
53
+ end
54
+
55
+ before do
56
+ visit spree.admin_login_path
57
+ fill_in 'Email', with: admin.email
58
+ fill_in 'Password', with: admin.password
59
+ click_button 'Login'
60
+ visit spree.admin_users_path
61
+ end
62
+
63
+ context 'if currently logged-in admin' do
64
+ context "clicks on an user's page" do
65
+ it 'can reset its password' do
66
+ within("#spree_user_#{user.id}") do
67
+ click_link user.email
68
+ end
69
+
70
+ click_button 'Reset password'
71
+ expect(page).to have_content(
72
+ 'If an account with that email address exists,
73
+ you will receive an email with instructions about
74
+ how to reset your password in a few minutes.'
75
+ )
76
+ end
77
+ end
78
+ end
79
+ end
37
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_auth_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.2.0
47
+ version: '2.6'
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '3'
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: 1.2.0
57
+ version: '2.6'
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3'
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 0.1.3
75
+ - !ruby/object:Gem::Dependency
76
+ name: deface
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.0'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.0'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: capybara
77
91
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +190,14 @@ dependencies:
176
190
  requirements:
177
191
  - - "~>"
178
192
  - !ruby/object:Gem::Version
179
- version: '3.3'
193
+ version: 4.0.0.beta2
180
194
  type: :development
181
195
  prerelease: false
182
196
  version_requirements: !ruby/object:Gem::Requirement
183
197
  requirements:
184
198
  - - "~>"
185
199
  - !ruby/object:Gem::Version
186
- version: '3.3'
200
+ version: 4.0.0.beta2
187
201
  - !ruby/object:Gem::Dependency
188
202
  name: rubocop
189
203
  requirement: !ruby/object:Gem::Requirement
@@ -288,7 +302,7 @@ dependencies:
288
302
  requirements:
289
303
  - - ">="
290
304
  - !ruby/object:Gem::Version
291
- version: 1.2.0
305
+ version: '2.6'
292
306
  - - "<"
293
307
  - !ruby/object:Gem::Version
294
308
  version: '3'
@@ -298,7 +312,7 @@ dependencies:
298
312
  requirements:
299
313
  - - ">="
300
314
  - !ruby/object:Gem::Version
301
- version: 1.2.0
315
+ version: '2.6'
302
316
  - - "<"
303
317
  - !ruby/object:Gem::Version
304
318
  version: '3'
@@ -308,7 +322,7 @@ dependencies:
308
322
  requirements:
309
323
  - - ">="
310
324
  - !ruby/object:Gem::Version
311
- version: 1.2.0
325
+ version: '2.6'
312
326
  - - "<"
313
327
  - !ruby/object:Gem::Version
314
328
  version: '3'
@@ -318,7 +332,7 @@ dependencies:
318
332
  requirements:
319
333
  - - ">="
320
334
  - !ruby/object:Gem::Version
321
- version: 1.2.0
335
+ version: '2.6'
322
336
  - - "<"
323
337
  - !ruby/object:Gem::Version
324
338
  version: '3'
@@ -326,16 +340,16 @@ dependencies:
326
340
  name: sqlite3
327
341
  requirement: !ruby/object:Gem::Requirement
328
342
  requirements:
329
- - - "~>"
343
+ - - ">="
330
344
  - !ruby/object:Gem::Version
331
- version: 1.3.6
345
+ version: '0'
332
346
  type: :development
333
347
  prerelease: false
334
348
  version_requirements: !ruby/object:Gem::Requirement
335
349
  requirements:
336
- - - "~>"
350
+ - - ">="
337
351
  - !ruby/object:Gem::Version
338
- version: 1.3.6
352
+ version: '0'
339
353
  description: Provides authentication and authorization services for use with Solidus
340
354
  by using Devise and CanCan.
341
355
  email: contact@solidus.io
@@ -356,8 +370,7 @@ files:
356
370
  - app/mailers/spree/user_mailer.rb
357
371
  - app/models/spree/auth_configuration.rb
358
372
  - app/models/spree/user.rb
359
- - app/overrides/auth_admin_login_navigation_bar.rb
360
- - app/overrides/auth_shared_login_bar.rb
373
+ - app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface
361
374
  - bin/rails
362
375
  - config/initializers/devise.rb
363
376
  - config/initializers/warden.rb
@@ -482,8 +495,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
495
  version: '0'
483
496
  requirements:
484
497
  - none
485
- rubyforge_project:
486
- rubygems_version: 2.7.3
498
+ rubygems_version: 3.0.6
487
499
  signing_key:
488
500
  specification_version: 4
489
501
  summary: Provides authentication and authorization services for use with Solidus by
@@ -1,10 +0,0 @@
1
- if SolidusSupport.solidus_gem_version < Gem::Version.new('1.2')
2
- Deface::Override.new(
3
- virtual_path: "spree/admin/shared/_header",
4
- name: "auth_admin_login_navigation_bar",
5
- insert_before: "[data-hook='admin_login_navigation_bar'], #admin_login_navigation_bar[data-hook]",
6
- partial: "spree/layouts/admin/login_nav",
7
- disabled: false,
8
- original: '841227d0aedf7909d62237d8778df99100087715'
9
- )
10
- end
@@ -1,10 +0,0 @@
1
- if SolidusSupport.frontend_available? && SolidusSupport.solidus_gem_version < Gem::Version.new('2.5.x')
2
- Deface::Override.new(
3
- virtual_path: "spree/shared/_nav_bar",
4
- name: "auth_shared_login_bar",
5
- insert_before: "li#search-bar",
6
- partial: "spree/shared/login_bar_items",
7
- disabled: false,
8
- original: 'eb3fa668cd98b6a1c75c36420ef1b238a1fc55ac'
9
- )
10
- end