From 88a58a057eca0bd77f5f351bd5172654153b1068 Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 4 May 2017 16:55:07 -0500 Subject: [PATCH] Removes not needed parameter token in process_and_verify_token. --- resources/prosody-plugins/mod_auth_token.lua | 4 +--- resources/prosody-plugins/token/util.lib.lua | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/resources/prosody-plugins/mod_auth_token.lua b/resources/prosody-plugins/mod_auth_token.lua index 2c8fe600a..d83f0b7bb 100644 --- a/resources/prosody-plugins/mod_auth_token.lua +++ b/resources/prosody-plugins/mod_auth_token.lua @@ -52,11 +52,9 @@ function provider.delete_user(username) end 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) - return token_util:process_and_verify_token(session, token); + return token_util:process_and_verify_token(session); end return new_sasl(host, { anonymous = get_username_from_token }); diff --git a/resources/prosody-plugins/token/util.lib.lua b/resources/prosody-plugins/token/util.lib.lua index f38e25304..162cefa78 100644 --- a/resources/prosody-plugins/token/util.lib.lua +++ b/resources/prosody-plugins/token/util.lib.lua @@ -183,15 +183,15 @@ function Util:verify_token(token) end --- 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: -- session.jitsi_meet_room - the room name value from the token -- session.jitsi_meet_domain - the domain name value from the token -- @param session the current session --- @param token the token to verify -- @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 return true; else @@ -217,9 +217,9 @@ function Util:process_and_verify_token(session, token) -- now verify the whole token local claims, msg; if self.asapKeyServer then - claims, msg = self:verify_token(token); + claims, msg = self:verify_token(session.auth_token); else - claims, msg = self:verify_token(token); + claims, msg = self:verify_token(session.auth_token); end if claims ~= nil then -- Binds room name to the session which is later checked on MUC join