jj-middleware 0.4.0 → 1.0.0

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
  SHA1:
3
- metadata.gz: 54113726efff4acd9e0bc11693bb9e6e420cc6d4
4
- data.tar.gz: 38d9b764429f1d9ecd643d94c28587ca53d406ba
3
+ metadata.gz: 9ddac0f6c59a12d3d877ef45218ffbed2cbef94d
4
+ data.tar.gz: 7183a18286a9c1a71a5ab68394e922668f2a3240
5
5
  SHA512:
6
- metadata.gz: ae7b8fec145fd36d705c99147e52deae4b6428b164b6a86f2b2bdcf7fb0801f08f28654dbd29dbfb8c5a81d3281fb22ccce075d8c2e6b9fd84e9252c51dafdbf
7
- data.tar.gz: 8f26c9470e0579cb39b7d87a0096612e16f7ded51ba3a2bf4941db02fad4686e7eaf01d79937ca1870dce3d6498cb8c4c4caedf66bcbc6679d14a113f0337528
6
+ metadata.gz: 56085af19906726369333841eeef7f281db07c819efbd1bb602d1076a8f58310151314c930302c619ba8bfe45d6a77f7d5b05c66f967ca5c1a8a4412f0c34b41
7
+ data.tar.gz: b0836c282e3102fe087ec1968d37584627384bdd51396559fb24b4fd2f40a1b8386db9b3cb7bff06b2566e0670f5b40a1bfd0635c1fad51a14a37d32dcb29bda
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rspec", "~> 3.0"
24
24
 
25
25
  spec.add_dependency "json"
26
- spec.add_dependency "wes-data-api", "~> 5"
26
+ spec.add_dependency "wes-data-api", "~> 6"
27
27
  end
@@ -12,8 +12,8 @@ module JJ
12
12
  def call(env)
13
13
  sess = Session.new(env)
14
14
  user = sess.fetch("user")
15
-
16
- unless user_exist?(user.id)
15
+
16
+ unless user_exist?(user)
17
17
  log.info("[JJ::Onboarding] User record not yet created.")
18
18
  record = create_user!(user.id)
19
19
  sess.set_model(record)
@@ -35,9 +35,8 @@ module JJ
35
35
  Wes::Data::API::CreatorUser.create(:auth0_id => user_id)
36
36
  end
37
37
 
38
- def user_exist?(user_id)
39
- user = Wes::Data::API::CreatorUser.find(:id, user_id)
40
- user && (user.auth0_id == user_id)
38
+ def user_exist?(user)
39
+ user && user.respond_to?("model") && (user.model.auth0_id == user.id)
41
40
  end
42
41
  end
43
42
  end
data/lib/jj/middleware.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module JJ
2
2
  module Middleware
3
- VERSION = "0.4.0".freeze
3
+ VERSION = "1.0.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jj-middleware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-23 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '5'
89
+ version: '6'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '5'
96
+ version: '6'
97
97
  description:
98
98
  email:
99
99
  - ''