Skip to content

Explain password sign-in refused by reCAPTCHA and offer browser sign-in - #71

Merged
aloth merged 2 commits into
mainfrom
fix/password-login-captcha
Nov 16, 2026
Merged

aloth merged 2 commits into
mainfrom
fix/password-login-captcha

Conversation

@aloth

@aloth aloth commented Nov 16, 2026

Copy link
Copy Markdown
Owner

overleaf.com requires a captcha for password sign-in. A login form post without a captcha token gets HTTP 400 with {"errorReason":"cannot_verify_user_not_robot", ...}, before the credentials are checked. olcli reported only "Password login failed (HTTP 400)".

  • Password login throws a new exported CaptchaRequiredError when the response has that errorReason. When the response gives no reason, it does the same if the login page has reCAPTCHA on for login (recaptchaDisabled.login === false in ol-ExposedSettings, or the reCAPTCHA script or widget). Wrong-password errors are unchanged.
  • The message points to olcli auth --browser and olcli auth --cookie. The CLI, the MCP server and the git remote helper all print it through formatError.
  • Interactive olcli auth --email (TTY, not CI) offers "Sign in in the browser instead? [Y/n]" and runs the --browser flow on yes. Scripts and other entry points never get a question.
  • olcli auth status warns about password credentials on overleaf.com and adds a warnings array to --json.
  • Help, README, docs and SKILL.md say password sign-in is for self-hosted servers without reCAPTCHA.
  • The spinner no longer animates on a terminal that reports a width of 0. ora divides by the column count to know how many lines to clear, so such a terminal made every frame print clear codes without end and olcli auth never finished.
  • Tests use local HTTP servers only.

overleaf.com requires a captcha for password sign-in and answers a login form post without a captcha token with HTTP 400 and a JSON body whose errorReason is "cannot_verify_user_not_robot", before the credentials are checked. olcli reported this only as "Password login failed (HTTP 400)".

fromPasswordLogin now throws CaptchaRequiredError (exported) when the response carries that errorReason, or, when the response gives no reason of its own, when the login page has reCAPTCHA switched on for login (recaptchaDisabled.login false in ol-ExposedSettings, or the reCAPTCHA script or widget on releases without that setting). The message names olcli auth --browser and olcli auth --cookie. formatError prints it for the CLI, the MCP server and the git remote helper. Wrong-password failures keep their existing messages.

An interactive olcli auth --email (TTY on stdin and stdout, not CI) asks whether to sign in in the browser instead and runs the auth --browser flow on yes; when no supported browser or WebSocket is available it prints the reason instead of asking. Scripts and all other entry points only get the message.

olcli auth status warns when password credentials would be used on overleaf.com and lists the warning in a new warnings array in --json output. Help texts, README, docs and SKILL.md now say that password sign-in works only on self-hosted servers without reCAPTCHA.
ora computes the lines to clear per frame by dividing by the stream's column count. A pseudo-terminal opened without a window size reports 0 columns, so the count became Infinity and every frame printed cursor-up and clear codes without end; olcli auth never finished. createSpinner now treats such a terminal like a pipe: no animation and the plain ok:/error: words. Verified against overleaf.com over a pty with a window size: the captcha message, the browser sign-in question and exit 1 on n.
@aloth
aloth merged commit c688217 into main Nov 16, 2026
2 checks passed
aloth added a commit that referenced this pull request Nov 16, 2026
Set version 0.18.0 in package.json, package-lock.json, CITATION.cff and server.json, and fold the Unreleased CHANGELOG entries of #66, #70 and #71 and the CONTRIBUTING.md change into the 0.18.0 section dated 2026-11-16.
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