--- a/mod_storage_mongodb/mod_storage_mongodb.lua Wed Dec 14 12:56:07 2011 +1100
+++ b/mod_storage_mongodb/mod_storage_mongodb.lua Mon Dec 19 10:36:50 2011 +1100
@@ -3,7 +3,9 @@
local params = assert ( module:get_option("mongodb") , "mongodb configuration not found" );
+prosody.unlock_globals();
local mongo = require "mongo";
+prosody.lock_globals();
local conn
@@ -48,7 +50,9 @@
if not conn then
conn = assert ( mongo.Connection.New ( true ) );
assert ( conn:connect ( params.server ) );
- assert ( conn:auth ( params ) );
+ if params.username then
+ assert ( conn:auth ( params ) );
+ end
end
if not typ then -- default key-value store