mod_rest/mod_rest.lua
changeset 5005 cb19cb1c03d6
parent 4992 732229fe68ab
child 5090 dec4b2e31d1c
equal deleted inserted replaced
5004:8b6fe33d1c9b 5005:cb19cb1c03d6
    47 		if not um.test_password(username, module.host, password) then
    47 		if not um.test_password(username, module.host, password) then
    48 			return false;
    48 			return false;
    49 		end
    49 		end
    50 		return { username = username, host = module.host };
    50 		return { username = username, host = module.host };
    51 	elseif auth_type == "Bearer" then
    51 	elseif auth_type == "Bearer" then
    52 		local token_info = tokens.get_token_info(auth_data);
    52 		if tokens.get_token_session then
    53 		if not token_info or not token_info.session then
    53 			return tokens.get_token_session(auth_data);
    54 			return false;
    54 		else -- COMPAT w/0.12
    55 		end
    55 			local token_info = tokens.get_token_info(auth_data);
    56 		return token_info.session;
    56 			if not token_info or not token_info.session then
       
    57 				return false;
       
    58 			end
       
    59 			return token_info.session;
       
    60 		end
    57 	end
    61 	end
    58 	return nil;
    62 	return nil;
    59 end
    63 end
    60 
    64 
    61 if module:get_option_string("authentication") == "anonymous" and module:get_option_boolean("anonymous_rest") then
    65 if module:get_option_string("authentication") == "anonymous" and module:get_option_boolean("anonymous_rest") then