Browse Source

Removes not needed parameter token in process_and_verify_token.

master
damencho 8 years ago
parent
commit
88a58a057e

+ 1
- 3
resources/prosody-plugins/mod_auth_token.lua View File

@@ -52,11 +52,9 @@ function provider.delete_user(username)
52 52
 end
53 53
 
54 54
 function provider.get_sasl_handler(session)
55
-	-- JWT token extracted from BOSH URL
56
-	local token = session.auth_token;
57 55
 
58 56
 	local function get_username_from_token(self, message)
59
-        return token_util:process_and_verify_token(session, token);
57
+        return token_util:process_and_verify_token(session);
60 58
 	end
61 59
 
62 60
 	return new_sasl(host, { anonymous = get_username_from_token });

+ 5
- 4
resources/prosody-plugins/token/util.lib.lua View File

@@ -183,15 +183,15 @@ function Util:verify_token(token)
183 183
 end
184 184
 
185 185
 --- Verifies token and process needed values to be stored in the session.
186
+-- Token is obtained from session.auth_token.
186 187
 -- Stores in session the following values:
187 188
 -- session.jitsi_meet_room - the room name value from the token
188 189
 -- session.jitsi_meet_domain - the domain name value from the token
189 190
 -- @param session the current session
190 191
 -- @return false and error
191
-function Util:process_and_verify_token(session, token)
192
+function Util:process_and_verify_token(session)
192 193
 
193
-    if token == nil then
194
+    if session.auth_token == nil then
194 195
         if self.allowEmptyToken then
195 196
             return true;
196 197
         else
@@ -217,9 +217,9 @@ function Util:process_and_verify_token(session, token)
217 217
     -- now verify the whole token
218 218
     local claims, msg;
219 219
     if self.asapKeyServer then
220
-        claims, msg = self:verify_token(token);
220
+        claims, msg = self:verify_token(session.auth_token);
221 221
     else
222
-        claims, msg = self:verify_token(token);
222
+        claims, msg = self:verify_token(session.auth_token);
223 223
     end
224 224
     if claims ~= nil then
225 225
         -- Binds room name to the session which is later checked on MUC join

Loading…
Cancel
Save