spree_api 4.0.3 → 4.0.4

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: fde99f29c7162d1e5aa807bedaee13a5ad7da6f09ff841ea4e1f80cd6bb901e9
4
- data.tar.gz: 11c11b3012259a69072fb6ba9c90bc5373436f17aa74f93e09f13b2a9d23189f
3
+ metadata.gz: fc158319298bbbcc29f0137370d6785232e6e9a03f1335a6759a1604daffd9d0
4
+ data.tar.gz: e4295163450d6523e8480f960fc239b72051b0ec8f5ad958ec95f6ea898334a4
5
5
  SHA512:
6
- metadata.gz: 0b82f3921072e81146d1483fb2f59bf9d2c18542646c9bfb52773bd3c3753c5a57a7206fe421f84a4ccfe7ee42c5770e4c91f3436bff7e7b02eb93033ff977f8
7
- data.tar.gz: 6cab7055aa44a7723bd1e042fa58428093d652ef2e0ec8d3af0dafc2422a64471aabd3d3ec646e7358ffa29ceef20595268d256b37079edac51043f4e6a97e72
6
+ metadata.gz: 32baa584cd58b7e51784162c1b6f630013cb4af832465fb4cfb313e9c914684d0898cbacab9e7237b57b78fea2ed5244e7b2c6c8499287260f542361bab3d9b8
7
+ data.tar.gz: 6194748bc05257b57003d98f751c5729815171fce592027b3858f40e600ac252284d34fd26b2676075bfe64d6019a55cda9265806aa94cb18741d2cce5d684f0
@@ -55,7 +55,12 @@ module Spree
55
55
  end
56
56
 
57
57
  def spree_current_user
58
- @spree_current_user ||= Spree.user_class.find_by(id: doorkeeper_token.resource_owner_id) if doorkeeper_token
58
+ return nil unless doorkeeper_token
59
+ return @spree_current_user if @spree_current_user
60
+
61
+ doorkeeper_authorize!
62
+
63
+ @spree_current_user ||= Spree.user_class.find_by(id: doorkeeper_token.resource_owner_id)
59
64
  end
60
65
 
61
66
  def spree_authorize!(action, subject, *args)
@@ -4,7 +4,7 @@ shared_context 'API v2 tokens' do
4
4
  let(:headers_order_token) { { 'X-Spree-Order-Token' => order.token } }
5
5
  end
6
6
 
7
- [200, 201, 400, 404, 403, 422].each do |status_code|
7
+ [200, 201, 400, 401, 404, 403, 422].each do |status_code|
8
8
  shared_examples "returns #{status_code} HTTP status" do
9
9
  it "returns #{status_code}" do
10
10
  expect(response.status).to eq(status_code)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-rspec
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.0.3
33
+ version: 4.0.4
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: 4.0.3
40
+ version: 4.0.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rabl
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -301,7 +301,7 @@ homepage: http://spreecommerce.org
301
301
  licenses:
302
302
  - BSD-3-Clause
303
303
  metadata: {}
304
- post_install_message:
304
+ post_install_message:
305
305
  rdoc_options: []
306
306
  require_paths:
307
307
  - lib
@@ -316,8 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  - !ruby/object:Gem::Version
317
317
  version: '0'
318
318
  requirements: []
319
- rubygems_version: 3.0.2
320
- signing_key:
319
+ rubygems_version: 3.1.4
320
+ signing_key:
321
321
  specification_version: 4
322
322
  summary: Spree's API
323
323
  test_files: []