katoadhoc 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/katoadhoc.rb +6 -2
- metadata +1 -1
data/lib/katoadhoc.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'jwt'
|
2
2
|
class KatoAdhoc
|
3
|
-
def self.setInfo(
|
3
|
+
def self.setInfo(cookies, skey, expiration_seconds, user_id, user_name, room_id, room_name)
|
4
4
|
token = JWT.encode({
|
5
5
|
"exp"=>(((Time.now.to_f * 1000).to_i) + expiration_seconds.to_i),
|
6
6
|
"user_id"=>user_id,
|
@@ -9,6 +9,10 @@ class KatoAdhoc
|
|
9
9
|
"room_name"=>room_name
|
10
10
|
}, skey)
|
11
11
|
|
12
|
-
|
12
|
+
cookies[:KATO_ADHOC_TOKEN] = token
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.unset(cookies)
|
16
|
+
cookies.delete :KATO_ADHOC_TOKEN
|
13
17
|
end
|
14
18
|
end
|