From a2ffe8c05efdc6c783149faaa72a7004605c7a99 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 1 Sep 2021 12:24:57 -0700 Subject: [PATCH] dont generate nonce for deleted members --- controller/PostgreSQL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 64b0767bf..5d48ce1f0 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -357,7 +357,7 @@ std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member, const std::s std::string nonce = ""; // 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() == 1) { // find an unused nonce, if one exists. pqxx::result r = w.exec_params("SELECT nonce FROM ztc_sso_expiry "