mod_http_xep227/mod_http_xep227.lua
changeset 5003 65cdbbf9703a
parent 4880 0f5f2d4475b9
equal deleted inserted replaced
5002:5ab134b7e510 5003:65cdbbf9703a
   344 	if not (auth_type and auth_data) then
   344 	if not (auth_type and auth_data) then
   345 		return false;
   345 		return false;
   346 	end
   346 	end
   347 
   347 
   348 	if auth_type == "Bearer" then
   348 	if auth_type == "Bearer" then
   349 		local token_info = tokens.get_token_info(auth_data);
   349 		return tokens.get_token_session(auth_data);
   350 		if not token_info or not token_info.session then
       
   351 			return false;
       
   352 		end
       
   353 		return token_info.session;
       
   354 	end
   350 	end
   355 	return nil;
   351 	return nil;
   356 end
   352 end
   357 
   353 
   358 local function check_auth(routes)
   354 local function check_auth(routes)