docs: function (data) {
  			//console.log("login_data");
  			//console.log(data);
  			if (data === null) {
  				var err = new Error("ACCOUNT_NOT_FOUND " + account);
  				err.name = "login Error";
  				err.code = 1;
  				return UTIL.safeCall(onDone, err);
  			}
  
  			// by default we assume authentication fails and return token does not exist
  			var result = false;
  			var token = undefined;		
  			
  			// determine to check password or check token
  			if (by_account)
  				result = (l_encryptPass(password) === data.password);
  			else
  				// NOTE: check if the requester of the token was the same as the one logined previously
  				result = (data.pass_tokens.hasOwnProperty(password));
  				
  			// check login is success or fail
  			if (result === true) {
  				l_addLogin(account, data, conn);
  				
  				// generate unique token and store it if requested
  				if (requester) {
  					var l_createTokenDone = function (l_createToken_err, token) {
  						if (l_createToken_err) {
  							var err = new Error("ACCOUNT_LOGIN_TOKENSTORE_FAIL: " + account);
  							err.name = "login Error";
  							err.code = 1;
  							UTIL.safeCall(onDone, err);
  						}
  						else {
  							UTIL.safeCall(onDone, null, {code: 0, msg: 'ACCOUNT_LOGIN_SUCCESS: ' + account, uid: data.uid, token: token, data: data});
  						}
  					};
  					l_createToken(data.uid, requester, l_createTokenDone);
  				}
  				else {
  					return UTIL.safeCall(onDone, null, {code: 0, msg: 'ACCOUNT_LOGIN_SUCCESS: ' + account, data: data});
  				}
  			}
  			else {
  				var err = new Error("ACCOUNT_LOGIN_PASSFAIL: " + account);
  				err.name = "login Error";
  				err.code = 1;
  				return UTIL.safeCall(onDone, err);
  			}
  		}