Add logging for user login process in handleLogin function to improve debugging and error tracking.
This commit is contained in:
@@ -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) {
|
void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt::WSpinBox *ageWidget, Wt::WComboBox *genderWidget) {
|
||||||
try {
|
try {
|
||||||
std::string nick = extractTrimmedUserName(userName);
|
std::string nick = extractTrimmedUserName(userName);
|
||||||
|
std::cout << "handleLogin() nick='" << nick << "'" << std::endl;
|
||||||
validateName(nick);
|
validateName(nick);
|
||||||
validateGender(genderWidget);
|
validateGender(genderWidget);
|
||||||
validateAge(ageWidget);
|
validateAge(ageWidget);
|
||||||
@@ -345,6 +346,7 @@ void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt:
|
|||||||
startChat();
|
startChat();
|
||||||
setCookie("wtd", sessionId(), 21000);
|
setCookie("wtd", sessionId(), 21000);
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
|
std::cerr << "handleLogin() exception: " << e.what() << std::endl;
|
||||||
Wt::WMessageBox::show("Attention", e.what(), Wt::StandardButton::Ok);
|
Wt::WMessageBox::show("Attention", e.what(), Wt::StandardButton::Ok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user