Add logging for user login process in handleLogin function to improve debugging and error tracking.

This commit is contained in:
Torsten Schulz (local)
2025-11-16 14:58:41 +01:00
parent ee52a35f91
commit 25c3d20885

View File

@@ -337,6 +337,7 @@ void App::populateCountryComboBox(Wt::WComboBox* countryWidget) {
void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt::WSpinBox *ageWidget, Wt::WComboBox *genderWidget) {
try {
std::string nick = extractTrimmedUserName(userName);
std::cout << "handleLogin() nick='" << nick << "'" << std::endl;
validateName(nick);
validateGender(genderWidget);
validateAge(ageWidget);
@@ -345,6 +346,7 @@ void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt:
startChat();
setCookie("wtd", sessionId(), 21000);
} catch (const std::exception& e) {
std::cerr << "handleLogin() exception: " << e.what() << std::endl;
Wt::WMessageBox::show("Attention", e.what(), Wt::StandardButton::Ok);
}
}