Removes not needed parameter token in process_and_verify_token.

This commit is contained in:
damencho 2017-05-04 16:55:07 -05:00 committed by Paweł Domas
parent 4bb51516bb
commit 88a58a057e
2 changed files with 6 additions and 8 deletions

View File

@ -52,11 +52,9 @@ function provider.delete_user(username)
end end
function provider.get_sasl_handler(session) function provider.get_sasl_handler(session)
-- JWT token extracted from BOSH URL
local token = session.auth_token;
local function get_username_from_token(self, message) local function get_username_from_token(self, message)
return token_util:process_and_verify_token(session, token); return token_util:process_and_verify_token(session);
end end
return new_sasl(host, { anonymous = get_username_from_token }); return new_sasl(host, { anonymous = get_username_from_token });

View File

@ -183,15 +183,15 @@ function Util:verify_token(token)
end end
--- Verifies token and process needed values to be stored in the session. --- Verifies token and process needed values to be stored in the session.
-- Token is obtained from session.auth_token.
-- Stores in session the following values: -- Stores in session the following values:
-- session.jitsi_meet_room - the room name value from the token -- session.jitsi_meet_room - the room name value from the token
-- session.jitsi_meet_domain - the domain name value from the token -- session.jitsi_meet_domain - the domain name value from the token
-- @param session the current session -- @param session the current session
-- @param token the token to verify
-- @return false and error -- @return false and error
function Util:process_and_verify_token(session, token) function Util:process_and_verify_token(session)
if token == nil then if session.auth_token == nil then
if self.allowEmptyToken then if self.allowEmptyToken then
return true; return true;
else else
@ -217,9 +217,9 @@ function Util:process_and_verify_token(session, token)
-- now verify the whole token -- now verify the whole token
local claims, msg; local claims, msg;
if self.asapKeyServer then if self.asapKeyServer then
claims, msg = self:verify_token(token); claims, msg = self:verify_token(session.auth_token);
else else
claims, msg = self:verify_token(token); claims, msg = self:verify_token(session.auth_token);
end end
if claims ~= nil then if claims ~= nil then
-- Binds room name to the session which is later checked on MUC join -- Binds room name to the session which is later checked on MUC join