realtime 0.0.1 → 0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddeb54e047fe444ad96f0ca4307e47878bbf69b9
|
4
|
+
data.tar.gz: a14d656cdbd3080033ae3b5f7a0f8f5c0c6f156b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d72dfb869afb8f373c029bdf5c675e33fa924d02695bdc32eba48045e53e5bf0aebefd25d916530ca685bad06c7d777c13264d17d62126207c10d913034a8d
|
7
|
+
data.tar.gz: dfc0462a33d0138649da1e12014861d78f6e99236c1687acab31ac73d349ec9adf16282585ccc76f64ed7aeb0841b58d2acc7709d8f51b5f147c3bc795693f5d
|
@@ -13,9 +13,7 @@
|
|
13
13
|
if (typeof io != 'undefined' && io != null) {
|
14
14
|
window.realtime.token = '<%= realtime_token %>';
|
15
15
|
window.realtime.userId = '<%= realtime_user_id %>';
|
16
|
-
|
17
|
-
document.cookie = "_rtToken=" + '<%= realtime_token %>' + ";domain=." + '<%= realtime_domain %>' + ";path=/"
|
18
|
-
window.realtime.socketIo = io.connect('<%= realtime_server_url %>');
|
16
|
+
window.realtime.socketIo = io.connect('<%= realtime_server_url %>/?_rtUserId=<%= @realtime_user_id %>&_rtToken=<%= @realtime_token %>');
|
19
17
|
}
|
20
18
|
|
21
19
|
if (window.realtime.socketIo) {
|
@@ -13,8 +13,7 @@ module Realtime
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def do_realtime_token
|
16
|
-
|
17
|
-
@realtime_token = cookies["_rtToken"]
|
16
|
+
@realtime_token = Digest::MD5.hexdigest("#{session[:session_id]}:#{realtime_user_id}")
|
18
17
|
return @realtime_token
|
19
18
|
end
|
20
19
|
|
@@ -39,6 +38,8 @@ module Realtime
|
|
39
38
|
session_data = {
|
40
39
|
"user_id" => realtime_user_id,
|
41
40
|
}
|
41
|
+
|
42
|
+
# todo: merge additional session data passed in
|
42
43
|
|
43
44
|
stored_session_data = JSON.generate(session_data)
|
44
45
|
|
@@ -50,6 +51,8 @@ module Realtime
|
|
50
51
|
|
51
52
|
# expire this realtime session after one day.
|
52
53
|
RedisWrapper.redis.expire("rtSession-" + realtime_user_id.to_s, 86400)
|
54
|
+
|
55
|
+
|
53
56
|
end
|
54
57
|
|
55
58
|
end
|
data/lib/realtime/version.rb
CHANGED