#32 this time properly
This commit is contained in:
@ -414,7 +414,7 @@ int main(int argc, char *argv[]) {
|
|||||||
ID_UPDATE_FREELANCER_PASSWORD_HASH
|
ID_UPDATE_FREELANCER_PASSWORD_HASH
|
||||||
});
|
});
|
||||||
pqxx::result freelancerEmail = Database::executePreparedStatement_SELECT_FREELANCER_EMAIL_FROM_PASSWORD_RESET_KEY(databaseConnection, passwordResetKey);
|
pqxx::result freelancerEmail = Database::executePreparedStatement_SELECT_FREELANCER_EMAIL_FROM_PASSWORD_RESET_KEY(databaseConnection, passwordResetKey);
|
||||||
if (!freelancerEmail.empty() && !password.empty() && password.compare(passwordConfirmation) != 0) {
|
if (!freelancerEmail.empty() && !password.empty() && password == passwordConfirmation) {
|
||||||
string email = freelancerEmail.at(0).at(0).c_str();
|
string email = freelancerEmail.at(0).at(0).c_str();
|
||||||
pqxx::result keyExpiration = Database::executePreparedStatement_SELECT_CHECK_FREELANCER_RESET_KEY_EXPIRED(databaseConnection, email);
|
pqxx::result keyExpiration = Database::executePreparedStatement_SELECT_CHECK_FREELANCER_RESET_KEY_EXPIRED(databaseConnection, email);
|
||||||
if (stoi(keyExpiration.at(0).at(0).c_str()) == 0) {
|
if (stoi(keyExpiration.at(0).at(0).c_str()) == 0) {
|
||||||
@ -445,7 +445,7 @@ int main(int argc, char *argv[]) {
|
|||||||
ctx[MUSTACHE_PASSWORD_EMPTY] = true;
|
ctx[MUSTACHE_PASSWORD_EMPTY] = true;
|
||||||
if (freelancerEmail.empty())
|
if (freelancerEmail.empty())
|
||||||
ctx[MUSTACHE_PASSWORD_RESET_DOES_NOT_EXIST] = true;
|
ctx[MUSTACHE_PASSWORD_RESET_DOES_NOT_EXIST] = true;
|
||||||
if (password.compare(passwordConfirmation) != 0)
|
if (password != passwordConfirmation)
|
||||||
ctx[MUSTACHE_PASSWORD_RESET_PASS_CONFIRMATION] = true;
|
ctx[MUSTACHE_PASSWORD_RESET_PASS_CONFIRMATION] = true;
|
||||||
}
|
}
|
||||||
auto page = crow::mustache::load(TEMPLATE_PASSWORD_RESET_FULFILMENT);
|
auto page = crow::mustache::load(TEMPLATE_PASSWORD_RESET_FULFILMENT);
|
||||||
|
Reference in New Issue
Block a user