quak login: say in words why the login failed (closes #244) #255

Merged
clawbot merged 3 commits from issue-244-login-failure-reasons into next 2026-11-19 09:18:18 +01:00
Collaborator

Closes #244

quak login now names two causes of a failed login:

  • a wrong password: Login failed: incorrect email or password
  • an email with no account on the server: Login failed: no account with this email on the server

Other failures print as before; the exit status stays 1.

The mapping is in src/auth/login.ts, per request, not in the CLI: the Ente server also answers 401 to a wrong TOTP or email code, so a blanket 401 rule would call a wrong second-factor code a wrong password. The rewritten error is still an ApiError with the same status, code and body.

Judgement call: the 404 is named only when its body is JSON. The Ente server answers an unknown email with {}; a --server address that points somewhere else answers 404 with text or HTML, and that keeps the bare HTTP 404 instead of claiming the account is missing.

The test fake server in test/auth/login.test.ts now answers a failed SRP check with 401 {}, as the Ente server does, instead of throwing inside fetch.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/quak/issues/244 `quak login` now names two causes of a failed login: - a wrong password: `Login failed: incorrect email or password` - an email with no account on the server: `Login failed: no account with this email on the server` Other failures print as before; the exit status stays 1. The mapping is in `src/auth/login.ts`, per request, not in the CLI: the Ente server also answers 401 to a wrong TOTP or email code, so a blanket 401 rule would call a wrong second-factor code a wrong password. The rewritten error is still an `ApiError` with the same status, code and body. Judgement call: the 404 is named only when its body is JSON. The Ente server answers an unknown email with `{}`; a `--server` address that points somewhere else answers 404 with text or HTML, and that keeps the bare `HTTP 404` instead of claiming the account is missing. The test fake server in `test/auth/login.test.ts` now answers a failed SRP check with 401 `{}`, as the Ente server does, instead of throwing inside `fetch`. Model: opus-5-5
clawbot self-assigned this 2026-11-19 07:46:31 +01:00
clawbot added 1 commit 2026-11-19 07:46:31 +01:00
A password the server refuses (401 from /users/srp/verify-session) now
fails with "incorrect email or password". An email the server has no
account for (404 with a JSON body from /users/srp/attributes) fails with
"no account with this email on the server". The error stays an ApiError
with the same status. A 404 without JSON, as from a server address that
is not an Ente server, keeps the bare "HTTP 404".

Model: opus-5-5
clawbot added the needs-review label 2026-11-19 07:46:38 +01:00
clawbot added 1 commit 2026-11-19 08:04:42 +01:00
The Ente server answers /users/srp/attributes with 404 and the code
NOT_FOUND when the account exists but has no SRP attributes, and with
404 and {} when no account has the email. Both were reported as "no
account with this email on the server". Only a 404 whose JSON body has
no code is named that way now.

Model: opus-5-5
clawbot added 1 commit 2026-11-19 08:28:03 +01:00
The README said every wrong password prints "incorrect email or
password". With email verification on, quak never sends the password
to the server: a wrong one fails while unlocking the keys and prints
the decryption error instead.

Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 88a6ce5b6b

quak login now names a refused password and an unknown email as #244 asks, and other failures print as before.

Outside this change: an account that exists but has no SRP attributes still prints Login failed: with an empty reason, because the server's NOT_FOUND answer carries an empty message.

Model: opus-5-5

Verdict: PASS Head: 88a6ce5b6b9b378355bcd1a3817edb3c80132202 `quak login` now names a refused password and an unknown email as https://git.eeqj.de/sneak/quak/issues/244 asks, and other failures print as before. Outside this change: an account that exists but has no SRP attributes still prints `Login failed: ` with an empty reason, because the server's `NOT_FOUND` answer carries an empty message. Model: opus-5-5
clawbot merged commit 367eac2ef7 into next 2026-11-19 09:18:18 +01:00
Sign in to join this conversation.