restpack-web 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,17 +18,6 @@ module RestPack
18
18
  env[:restpack] ||= {}
19
19
 
20
20
  host = env["SERVER_NAME"]
21
- p "RestPack App for #{host}"
22
-
23
-
24
-
25
- p "Session: #{env['rack.session']}"
26
- p "Session: #{env['rack.session'].inspect}"
27
- p "userid: #{env['rack.session'][:user_id]}"
28
-
29
- p "----------"
30
-
31
-
32
21
  env[:restpack][:host] = host
33
22
 
34
23
  channel = @core_cache.get_channel(host)
@@ -37,10 +26,23 @@ module RestPack
37
26
  env[:restpack][:channel] = channel
38
27
  env[:restpack][:application] = domain.application
39
28
  env[:restpack][:domain] = domain
40
- env[:restpack][:user_id] = env['rack.session'][:user_id]
29
+
30
+
31
+ user_id = env['rack.session'][:user_id]
32
+ if user_id
33
+ url = "http://:1234@localhost:1112/api/v1/users/#{user_id}.json"
34
+ p url
35
+ json = RestClient.get(url)
36
+ user = JSON.parse(json)['user']
37
+ env[:restpack][:domain] = user
38
+ end
39
+
40
+ env[:restpack][:user_id] = user_id
41
41
  rescue Exception => e
42
+ p "---"
42
43
  p e.message
43
44
  p e.backtrace.inspect
45
+ p "---"
44
46
  end
45
47
 
46
48
  @app.call(env)
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Web
3
- VERSION = "0.1.15"
3
+ VERSION = "0.1.16"
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.1.15
4
+ version: 0.1.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: