restpack-web 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restpack-web/app.rb +4 -2
- data/lib/restpack-web/version.rb +1 -1
- metadata +1 -1
data/lib/restpack-web/app.rb
CHANGED
@@ -48,15 +48,17 @@ module RestPack
|
|
48
48
|
|
49
49
|
def add_user(env)
|
50
50
|
user_id = env['rack.session'][:user_id]
|
51
|
+
p "GJ: user_id: [#{user_id}]"
|
51
52
|
if user_id
|
52
53
|
url = "http://:1234@localhost:1112/api/v1/users/#{user_id}.json" #TODO: GJ: build from config
|
53
54
|
p url
|
54
55
|
json = RestClient.get(url)
|
55
56
|
user = JSON.parse(json)['user']
|
56
57
|
env[:restpack][:user] = user
|
58
|
+
env[:restpack][:user_id] = user_id
|
59
|
+
else
|
60
|
+
env[:restpack][:user_id] = nil
|
57
61
|
end
|
58
|
-
|
59
|
-
env[:restpack][:user_id] = user_id
|
60
62
|
end
|
61
63
|
|
62
64
|
end
|
data/lib/restpack-web/version.rb
CHANGED