Skip to content

fix(webserver): show login error message on failed login - #82

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/login-error-feedback
Jun 11, 2026
Merged

fix(webserver): show login error message on failed login#82
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/login-error-feedback

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

The webserver backend sets $_SESSION["login_error"] when a login attempt fails (wrong password, invalid hash, or no password configured), but login.php never printed it: a wrong password just re-rendered the login form with no feedback, leaving the user with no clue why they were not logged in.

Echo the session variable next to the login form, styled in red, when it is non-empty. The message is a static server-provided string (WebServer.cpp), so no escaping is needed. The error only shows on the response to the failed attempt itself, since the backend resets login_error at the start of every request.

Verified against a running amuleweb: a wrong password now renders "Password incorrect, please try again." under the form, a fresh visit shows no message, and the correct password still logs in.

The webserver backend sets $_SESSION["login_error"] when a login
attempt fails (wrong password, invalid hash, or no password
configured), but login.php never printed it: a wrong password just
re-rendered the login form with no feedback, leaving the user with
no clue why they were not logged in.

Echo the session variable next to the login form, styled in red,
when it is non-empty. The message is a static server-provided
string (WebServer.cpp), so no escaping is needed. The error only
shows on the response to the failed attempt itself, since the
backend resets login_error at the start of every request.

Verified against a running amuleweb: a wrong password now renders
"Password incorrect, please try again." under the form, a fresh
visit shows no message, and the correct password still logs in.
@ngosang
ngosang merged commit 3c6f986 into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the fix/login-error-feedback branch June 11, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant