shopapp 0.0.8 → 0.0.9
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.
- checksums.yaml +4 -4
- data/app/controllers/concerns/shoplift_client.rb +5 -2
- data/shopapp.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a6b558b605efa87a9d28d3faace648da4ded444
|
|
4
|
+
data.tar.gz: 5d25093f083cbac07baa4d733f1e77ee99d97911
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 476712af35988887b5a230a6167b97e3d30c7fb224edcb99b3d91926e59521621d6ac96ed00d8d06f7b40a7886068cadd0ad0a2b3979a5534243adfb21341c7a
|
|
7
|
+
data.tar.gz: ee334809a41bca6f57f972bc7be06e914ac07498d855facbcf82fffdbe0a6f19587a35ae5b91747bf1be81596faa4f086bee5c075893c9e166d9aa7e4b4b52e9
|
|
@@ -84,11 +84,13 @@ module ShopliftClient
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def authenticate_user_or_api!
|
|
87
|
-
|
|
87
|
+
unless authenticate_company!(true)
|
|
88
|
+
redirect_unauthorized
|
|
89
|
+
end
|
|
88
90
|
end
|
|
89
91
|
|
|
90
92
|
def authenticate_company!(soft = false)
|
|
91
|
-
return if authenticate_user
|
|
93
|
+
return true if authenticate_user
|
|
92
94
|
|
|
93
95
|
@api_key = if params['key'].present?
|
|
94
96
|
params['key'].match(/[0-9a-f]+/).to_s
|
|
@@ -116,6 +118,7 @@ module ShopliftClient
|
|
|
116
118
|
|
|
117
119
|
@authentication = JSON.parse response.body
|
|
118
120
|
find_company_by_code authentication['company']
|
|
121
|
+
true
|
|
119
122
|
end
|
|
120
123
|
|
|
121
124
|
def current_user
|
data/shopapp.gemspec
CHANGED