Skip to content

fix-low: say why a login was refused when the server says why - #69

Open
nabbi wants to merge 1 commit into
ZoneMinder:mainfrom
nabbi:fix/az34-login-errors
Open

nabbi wants to merge 1 commit into
ZoneMinder:mainfrom
nabbi:fix/az34-login-errors

Conversation

@nabbi

@nabbi nabbi commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Impact: low (a user with API access turned off, or a user name zm-api refuses, is told "Invalid username or password")

Automated PR, tested in a zm-holodeck sandbox. An AI agent (Claude Opus 5.5) wrote this against a disposable
ZoneMinder (master 03cfd5b6f, zm-api main 1e7c5f8) and ran the checks there. Minimal human review before
opening: please review it as you would any contributor's PR.

TL;DR

Tested as e26094d8f; a6be57045 is the same tree with fixes #68 in the message.

fixes #68

🤖 Generated with Claude Code

API v2 answers a user whose API access is turned off (API Enabled unset)
401 "API disabled for: <user>", and only once the password is right, but
every login 401 read as "Invalid username or password". That message is
now "API access is disabled for user <user>".

zm-api checks the user name's format before the password and answers 400
for a name outside 3-64 letters, digits, "_", "." and "-". ZoneMinder
allows other names ("cam viewer", "ha@home"), so that 400 isn't a wrong
password either: it now names the refused user name and zm-api's reason.

Both still raise ZMAuthenticationError: the account can't log in until an
admin changes something, and only the message changes.

fixes ZoneMinder#68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Login errors say "Invalid username or password" when the server says why

1 participant