solidus_auth_devise 1.2.1 → 1.2.2
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 +4 -4
- data/app/models/spree/user.rb +2 -1
- data/solidus_auth_devise.gemspec +3 -2
- data/spec/models/user_spec.rb +25 -5
- metadata +23 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 675e862ec8ab71a91e01f264e3129610da0451c4
|
4
|
+
data.tar.gz: 07953550240e0abc1db4788de29c4084efa8d64e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17f0524a70349a714c4a06cd1c736a11eb8587f0985aac5e63ac20f88efdf1d0f4da2b6a6c3730f1abdd034bc275a2eb0cac8268ed1b8047ac4429dfd3743d55
|
7
|
+
data.tar.gz: 39159f5664b93a5a9f0dd1a1268829b5689d96dfc2ae931b630e07fc3126fe94f583a734872416b62486a71e1d6624d9eb71450f826b2ecf32960a89293f1510
|
data/app/models/spree/user.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Spree
|
2
|
-
class User <
|
2
|
+
class User < Spree::Base
|
3
3
|
include UserMethods
|
4
4
|
|
5
5
|
devise :database_authenticatable, :registerable, :recoverable,
|
@@ -8,6 +8,7 @@ module Spree
|
|
8
8
|
|
9
9
|
acts_as_paranoid
|
10
10
|
after_destroy :scramble_email_and_password
|
11
|
+
before_update { generate_spree_api_key if encrypted_password_changed? && spree_api_key.present? }
|
11
12
|
|
12
13
|
has_many :orders
|
13
14
|
|
data/solidus_auth_devise.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.name = "solidus_auth_devise"
|
6
|
-
s.version = "1.2.
|
6
|
+
s.version = "1.2.2"
|
7
7
|
s.summary = "Provides authentication and authorization services for use with Solidus by using Devise and CanCan."
|
8
8
|
s.description = s.summary
|
9
9
|
|
@@ -18,11 +18,12 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_path = "lib"
|
19
19
|
s.requirements << "none"
|
20
20
|
|
21
|
-
solidus_version = [">= 1.
|
21
|
+
solidus_version = [">= 1.1.0.alpha", "< 2"]
|
22
22
|
|
23
23
|
s.add_dependency "solidus_core", solidus_version
|
24
24
|
s.add_dependency "devise", '~> 3.5.1'
|
25
25
|
s.add_dependency "devise-encryptable", "0.1.2"
|
26
|
+
s.add_dependency 'deface', '~> 1.0.0'
|
26
27
|
|
27
28
|
s.add_dependency "json"
|
28
29
|
s.add_dependency "multi_json"
|
data/spec/models/user_spec.rb
CHANGED
@@ -7,11 +7,31 @@ RSpec.describe Spree::User, type: :model do
|
|
7
7
|
expect(create(:user).admin?).to be false
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
user
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
context "recoverable" do
|
11
|
+
let(:user) { create(:user) }
|
12
|
+
|
13
|
+
it 'generates the reset password token' do
|
14
|
+
expect(Spree::UserMailer).to receive(:reset_password_instructions).with(user, anything, {}).and_return(double(deliver: true))
|
15
|
+
expect { user.send_reset_password_instructions }.to change(user, :reset_password_token).to be_present
|
16
|
+
end
|
17
|
+
|
18
|
+
it "regenerates a spree api key on successful password change" do
|
19
|
+
user.generate_spree_api_key!
|
20
|
+
|
21
|
+
user.password = "123456678"
|
22
|
+
user.password_confirmation = "123456678"
|
23
|
+
expect { user.save! }.to change(user, :spree_api_key)
|
24
|
+
expect(user.spree_api_key).to be_present
|
25
|
+
end
|
26
|
+
|
27
|
+
it "does not generate a spree api key on password change if no key existed previously" do
|
28
|
+
user.clear_spree_api_key!
|
29
|
+
|
30
|
+
user.password = "123456678"
|
31
|
+
user.password_confirmation = "123456678"
|
32
|
+
expect { user.save! }.not_to change(user, :spree_api_key)
|
33
|
+
expect(user.reload.spree_api_key).to be_nil
|
34
|
+
end
|
15
35
|
end
|
16
36
|
|
17
37
|
context '#destroy' do
|
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: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.1.0.alpha
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: 1.1.0.alpha
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - '='
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 0.1.2
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: deface
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.0.0
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.0.0
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: json
|
63
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,7 +106,7 @@ dependencies:
|
|
92
106
|
requirements:
|
93
107
|
- - ">="
|
94
108
|
- !ruby/object:Gem::Version
|
95
|
-
version: 1.
|
109
|
+
version: 1.1.0.alpha
|
96
110
|
- - "<"
|
97
111
|
- !ruby/object:Gem::Version
|
98
112
|
version: '2'
|
@@ -102,7 +116,7 @@ dependencies:
|
|
102
116
|
requirements:
|
103
117
|
- - ">="
|
104
118
|
- !ruby/object:Gem::Version
|
105
|
-
version: 1.
|
119
|
+
version: 1.1.0.alpha
|
106
120
|
- - "<"
|
107
121
|
- !ruby/object:Gem::Version
|
108
122
|
version: '2'
|
@@ -112,7 +126,7 @@ dependencies:
|
|
112
126
|
requirements:
|
113
127
|
- - ">="
|
114
128
|
- !ruby/object:Gem::Version
|
115
|
-
version: 1.
|
129
|
+
version: 1.1.0.alpha
|
116
130
|
- - "<"
|
117
131
|
- !ruby/object:Gem::Version
|
118
132
|
version: '2'
|
@@ -122,7 +136,7 @@ dependencies:
|
|
122
136
|
requirements:
|
123
137
|
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.
|
139
|
+
version: 1.1.0.alpha
|
126
140
|
- - "<"
|
127
141
|
- !ruby/object:Gem::Version
|
128
142
|
version: '2'
|
@@ -406,7 +420,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
406
420
|
requirements:
|
407
421
|
- none
|
408
422
|
rubyforge_project:
|
409
|
-
rubygems_version: 2.2.
|
423
|
+
rubygems_version: 2.2.5
|
410
424
|
signing_key:
|
411
425
|
specification_version: 4
|
412
426
|
summary: Provides authentication and authorization services for use with Solidus by
|
@@ -447,4 +461,3 @@ test_files:
|
|
447
461
|
- spec/support/email.rb
|
448
462
|
- spec/support/factory_girl.rb
|
449
463
|
- spec/support/spree.rb
|
450
|
-
has_rdoc:
|