password reset route handler
This commit is contained in:
20
src/main.cpp
20
src/main.cpp
@ -317,6 +317,26 @@ int main(int argc, char *argv[]) {
|
||||
auto page = crow::mustache::load("freelancer_Login_PasswordReset.html");
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to reset a password from a requested PasswordReset
|
||||
*/
|
||||
CROW_ROUTE(app, "/passwordreset/<string>")
|
||||
([&, configuration](string passwordResetKey) {
|
||||
crow::mustache::context ctx;
|
||||
pqxx::connection databaseConnection(configuration.databaseConnectionString);
|
||||
pqxx::result freelancerEmail = Database::executePreparedStatement_SELECT_FREELANCER_EMAIL_FROM_PASSWORD_RESET_KEY(databaseConnection, passwordResetKey);
|
||||
if (!freelancerEmail.empty()) {
|
||||
ctx["freelanceremail"] = freelancerEmail.at(0).at(0).c_str();
|
||||
ctx["passwordresetkey"] = passwordResetKey;
|
||||
}
|
||||
else {
|
||||
ctx["PASSWORD_RESET_DOES_NOT_EXIST"] = true;
|
||||
}
|
||||
auto page = crow::mustache::load("passwordReset.html");
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to log in fulfillment
|
||||
*/
|
||||
|
Reference in New Issue
Block a user