restpack-web 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,15 +49,17 @@ module RestPack
49
49
  def add_user(env)
50
50
  user_id = env['rack.session'][:user_id]
51
51
  p "GJ: user_id: [#{user_id}]"
52
- if user_id
52
+
53
+ if user_id.nil? || user_id == ''
54
+ p "GJ: NIL"
55
+ env[:restpack][:user_id] = nil
56
+ else
53
57
  url = "http://:1234@localhost:1112/api/v1/users/#{user_id}.json" #TODO: GJ: build from config
54
58
  p url
55
59
  json = RestClient.get(url)
56
60
  user = JSON.parse(json)['user']
57
61
  env[:restpack][:user] = user
58
62
  env[:restpack][:user_id] = user_id
59
- else
60
- env[:restpack][:user_id] = nil
61
63
  end
62
64
  end
63
65
 
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Web
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: