spree_auth_devise 3.3.1 → 3.3.3

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfcdcf44851c015f6f95b9109c1f9c962da34b30
4
- data.tar.gz: 29daaafa06f9be7e11e11ccd8120db03d51641fc
3
+ metadata.gz: e902c04485979a2fa5edef1ee2030009f72b7bdd
4
+ data.tar.gz: 1693dcc6df3d9d607141148bdf046d12d94e1486
5
5
  SHA512:
6
- metadata.gz: 2e2912c801d9c5e1f647cdf6805cebb01b6880064f16434e9a84530ee7a870d4bae4b33ccfbeabb7dfb0c3c1d9ae03f78177a543653c6a1628e4ade0c299dded
7
- data.tar.gz: fd819d69a5f6f28d233964dc6fcdccaf812083b53e8816593c2f46715e6f022dcee0fb506a31e65122c4b34a62d34d6227d2dab1e010336a5ca38f7d9820ca2f
6
+ metadata.gz: 62a8aa9e430c10648caa3ad8f0fc67ca7c34c2b5c5750004cbabf2fbaad9ded6d0c57f69d3ed2bcd1bbbf10c3a8011de9b9d1ac4631debe77a8ff66e17948ed4
7
+ data.tar.gz: 19dab7108baddae24a3d3f4acba1c0d5d07ae3f339a9b4e44eebe3bf03e0d403e4c588df0b47d5e58e70ac5ac20899a15a8c9f2403b31cafae1b1e1e225d976a
@@ -12,6 +12,7 @@ env:
12
12
  language: ruby
13
13
 
14
14
  rvm:
15
+ - 2.4.2
15
16
  - 2.3.1
16
17
  - 2.2.7
17
18
 
@@ -20,5 +21,9 @@ gemfile:
20
21
  - gemfiles/spree_3_2.gemfile
21
22
  - gemfiles/spree_master.gemfile
22
23
 
24
+ matrix:
25
+ allow_failures:
26
+ - gemfile: gemfiles/spree_master.gemfile
27
+
23
28
  before_install:
24
29
  - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
data/README.md CHANGED
@@ -67,6 +67,14 @@ Devise.setup do |config|
67
67
  end
68
68
  ```
69
69
 
70
+ ### Sign out after password change
71
+
72
+ To disable signout after password change you must add this line to an initializer in your Rails project (typically `config/initializers/spree.rb`):
73
+
74
+ ```ruby
75
+ Spree::Auth::Config[:signout_after_password_change] = false
76
+ ```
77
+
70
78
  ## Using in an existing Rails application
71
79
 
72
80
  If you are installing Spree inside of a host application in which you want your own permission setup, you can do this using spree_auth_devise's register_ability method.
@@ -3,6 +3,8 @@ en:
3
3
  spree:
4
4
  admin_login: "Admin Login"
5
5
  change_your_password: "Change your password"
6
+ store_credits:
7
+ credit_balance: Store Credit Balance
6
8
  devise:
7
9
  confirmations:
8
10
  confirmed: Your account was successfully confirmed. You are now signed in.
@@ -0,0 +1,8 @@
1
+ Spree.fetch_account = function() {
2
+ return $.ajax({
3
+ url: Spree.pathFor("account_link"),
4
+ success: function(data) {
5
+ return $(data).insertBefore("li#search-bar");
6
+ }
7
+ });
8
+ };
@@ -27,8 +27,12 @@ class Spree::UsersController < Spree::StoreController
27
27
  if @user.update_attributes(user_params)
28
28
  if params[:user][:password].present?
29
29
  # this logic needed b/c devise wants to log us out after password changes
30
- user = Spree::User.reset_password_by_token(params[:user])
31
- sign_in(@user, event: :authentication, bypass: !Spree::Auth::Config[:signout_after_password_change])
30
+ Spree::User.reset_password_by_token(params[:user])
31
+ if Spree::Auth::Config[:signout_after_password_change]
32
+ sign_in(@user, event: :authentication)
33
+ else
34
+ bypass_sign_in(@user)
35
+ end
32
36
  end
33
37
  redirect_to spree.account_url, notice: Spree.t(:account_updated)
34
38
  else
@@ -4,6 +4,11 @@
4
4
  <dl id="user-info">
5
5
  <dt><%= Spree.t(:email) %></dt>
6
6
  <dd><%= @user.email %> (<%= link_to Spree.t(:edit), spree.edit_account_path %>)</dd>
7
+ <br />
8
+ <dt><%= Spree.t(:credit_balance, scope: [:store_credits])%></dt>
9
+ <dd>
10
+ <%= Spree::Money.new(spree_current_user.total_available_store_credit, currency: Spree::Config[:currency]) %>
11
+ </dd>
7
12
  </dl>
8
13
  </div>
9
14
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :confirmed_user, parent: :user do
3
3
  confirmed_at { Time.now }
4
4
  confirmation_sent_at { Time.now }
@@ -1,5 +1,5 @@
1
- require 'factory_girl'
1
+ require 'factory_bot'
2
2
 
3
3
  RSpec.configure do |config|
4
- config.include FactoryGirl::Syntax::Methods
4
+ config.include FactoryBot::Syntax::Methods
5
5
  end
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = 'spree_auth_devise'
6
- s.version = '3.3.1'
6
+ s.version = '3.3.3'
7
7
  s.summary = 'Provides authentication and authorization services for use with Spree by using Devise and CanCan.'
8
8
  s.description = s.summary
9
9
 
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.author = 'Sean Schofield'
13
13
  s.email = 'sean@spreecommerce.com'
14
- s.homepage = 'http://spreecommerce.com'
14
+ s.homepage = 'https://spreecommerce.org'
15
15
  s.license = 'BSD-3-Clause'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_path = 'lib'
20
20
  s.requirements << 'none'
21
21
 
22
- s.add_dependency 'devise', '~> 4.3.0'
22
+ s.add_dependency 'devise', '~> 4.4.0'
23
23
  s.add_dependency 'devise-encryptable', '0.2.0'
24
24
 
25
25
  spree_version = '>= 3.1.0', '< 4.0'
@@ -31,11 +31,11 @@ Gem::Specification.new do |s|
31
31
  s.add_development_dependency 'coffee-rails', '~> 4.2'
32
32
  s.add_development_dependency 'database_cleaner', '~> 1.5'
33
33
  s.add_development_dependency 'email_spec', '~> 2.1'
34
- s.add_development_dependency 'factory_girl', '~> 4.7'
34
+ s.add_development_dependency 'factory_bot', '~> 4.7'
35
35
  s.add_development_dependency 'ffaker'
36
36
  s.add_development_dependency 'launchy'
37
37
  s.add_development_dependency 'mysql2'
38
- s.add_development_dependency 'pg'
38
+ s.add_development_dependency 'pg', '~> 0.18'
39
39
  s.add_development_dependency 'poltergeist', '~> 1.6'
40
40
  s.add_development_dependency 'pry'
41
41
  s.add_development_dependency 'rspec-rails', '~> 3.5'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_auth_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-24 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.3.0
19
+ version: 4.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.3.0
26
+ version: 4.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: devise-encryptable
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ dependencies:
143
143
  - !ruby/object:Gem::Version
144
144
  version: '2.1'
145
145
  - !ruby/object:Gem::Dependency
146
- name: factory_girl
146
+ name: factory_bot
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
@@ -202,16 +202,16 @@ dependencies:
202
202
  name: pg
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - ">="
205
+ - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '0'
207
+ version: '0.18'
208
208
  type: :development
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - ">="
212
+ - - "~>"
213
213
  - !ruby/object:Gem::Version
214
- version: '0'
214
+ version: '0.18'
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: poltergeist
217
217
  requirement: !ruby/object:Gem::Requirement
@@ -401,7 +401,7 @@ files:
401
401
  - gemfiles/spree_3_2.gemfile
402
402
  - gemfiles/spree_master.gemfile
403
403
  - lib/assets/javascripts/spree/backend/spree_auth.js.erb
404
- - lib/assets/javascripts/spree/frontend/account.js.coffee
404
+ - lib/assets/javascripts/spree/frontend/account.js
405
405
  - lib/assets/javascripts/spree/frontend/spree_auth.js.erb
406
406
  - lib/assets/stylesheets/spree/backend/spree_auth.css.erb
407
407
  - lib/assets/stylesheets/spree/frontend/spree_auth.css.erb
@@ -483,7 +483,7 @@ files:
483
483
  - spec/support/factory_girl.rb
484
484
  - spec/support/spree.rb
485
485
  - spree_auth_devise.gemspec
486
- homepage: http://spreecommerce.com
486
+ homepage: https://spreecommerce.org
487
487
  licenses:
488
488
  - BSD-3-Clause
489
489
  metadata: {}
@@ -504,7 +504,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
504
504
  requirements:
505
505
  - none
506
506
  rubyforge_project:
507
- rubygems_version: 2.6.12
507
+ rubygems_version: 2.6.10
508
508
  signing_key:
509
509
  specification_version: 4
510
510
  summary: Provides authentication and authorization services for use with Spree by
@@ -1,5 +0,0 @@
1
- Spree.fetch_account = ->
2
- $.ajax
3
- url: Spree.pathFor("account_link"),
4
- success: (data) ->
5
- $(data).insertBefore("li#search-bar")