瀏覽代碼

dont generate nonce for deleted members

Grant Limberg 3 年之前
父節點
當前提交
a2ffe8c05e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      controller/PostgreSQL.cpp

+ 1 - 1
controller/PostgreSQL.cpp

@@ -357,7 +357,7 @@ std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member, const std::s
 		std::string nonce = "";
 		std::string nonce = "";
 
 
 		// check if the member exists first.
 		// check if the member exists first.
-		pqxx::row count = w.exec_params1("SELECT count(id) FROM ztc_member WHERE id = $1 AND network_id = $2", memberId, networkId);
+		pqxx::row count = w.exec_params1("SELECT count(id) FROM ztc_member WHERE id = $1 AND network_id = $2 AND deleted = false", memberId, networkId);
 		if (count[0].as<int>() == 1) {
 		if (count[0].as<int>() == 1) {
 			// find an unused nonce, if one exists.
 			// find an unused nonce, if one exists.
 			pqxx::result r = w.exec_params("SELECT nonce FROM ztc_sso_expiry "
 			pqxx::result r = w.exec_params("SELECT nonce FROM ztc_sso_expiry "