solidus_backend_devise_token_auth 2.8.0.alpha.10 → 2.8.0.alpha.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29a7d32a8cb2a8c208226941f4587f5428e9a04169843e8157324ac570d77218
4
- data.tar.gz: 16da5fffe41bbee42bdd07fd55ac3c0b980934a5da05da8e125778a8ae48621b
3
+ metadata.gz: 9206d5055c67ff8fc7120c6569ef65497a839657dd0aedd4028054574b76dbcd
4
+ data.tar.gz: 729be64d1f9585960eea54fe18e02bd87b943b3dcb806e04563b3b6693d7b946
5
5
  SHA512:
6
- metadata.gz: a98965aa70e3f4e8687f45602f4820c7a5f25d7593ee14aad3f1216324e180901e2a177c9ce814a78412b7f25b9350ddc0fc259e9b39018c90d9d6c904c20353
7
- data.tar.gz: 4f4c3da51f3ddc360e25fb1e7a7359c9bd990db098883c08705bd62ccbe03be58ef07af0097d0f36a7d2135e39dbb097d112aa66b0aa31e0e459dd1af2a331c5
6
+ metadata.gz: 148df8c2ecdddb368d116926da409213fd7c131863af050b7da7bb8dec37dd53ab24533848fa2d534900f380df85363b1a79ab08b5260ffafc3abca733972a92
7
+ data.tar.gz: ef4d0e981fb5febcf9f5f1de002ba377aec50efc20e789b3f218fade306a00d1a33fb626e3eb0c95651e52dba3fe3726d74f5c191d41c02ee15cf6108fbd5f1d
@@ -1,4 +1,10 @@
1
1
  Spree.ready(function() {
2
+ var appendAuthHeaders = function(xhr, settings) {
3
+ for (var key in Spree.accessTokenData) {
4
+ xhr.setRequestHeader(key, Spree.accessTokenData[key]);
5
+ }
6
+ };
7
+
2
8
  var updateAuthCredentials = function(ev, xhr, settings) {
3
9
  $("#progress").hide();
4
10
 
@@ -20,9 +26,11 @@ Spree.ready(function() {
20
26
  for(var key in newHeaders) {
21
27
  Spree.accessTokenData[key] = newHeaders[key];
22
28
  }
23
-
24
29
  };
25
30
 
31
+ // intercept requests to the API, append auth headers
32
+ $.ajaxSetup({ beforeSend: appendAuthHeaders });
33
+
26
34
  // update auth creds after each request to the API
27
35
  $(document).ajaxComplete(updateAuthCredentials);
28
36
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_backend_devise_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0.alpha.10
4
+ version: 2.8.0.alpha.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Siwek (skycocker)
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.0.alpha.10
19
+ version: 2.8.0.alpha.11
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: 2.8.0.alpha.10
26
+ version: 2.8.0.alpha.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core_devise_token_auth
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.0.alpha.10
33
+ version: 2.8.0.alpha.11
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.8.0.alpha.10
40
+ version: 2.8.0.alpha.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coffee-rails
43
43
  requirement: !ruby/object:Gem::Requirement