fix(login): a denied device request says how to recover; pin @types/node majors - #57
Merged
Merged
Conversation
…@types/node
Two loose ends from the LOOP-17 device-auth work.
The CLI reported a denial as "authorization denied in the browser" — a verdict
with no next step, which reads like the account was rejected rather than one
request being refused. Denial is recoverable: nothing was authorized, no key was
created, and re-running the command starts a fresh request. The message now says
that.
It also names the case the user cannot otherwise know about. A device request is
bound to no one until someone acts on it, so any signed-in account that learns a
user_code can refuse it. A denial the user did not perform therefore means their
code reached somebody else, which is worth telling them while they still have
the terminal open. This is the CLI half of the accepted-risk note in the
2026-07-28 phishing-resistance spec.
Deliberately one line: formatErrorLine puts its glyph on the first line only, so
a multi-line message loses it on every line after the first. The existing
login.test.ts assertions pass unchanged.
Also pins @types/node against major bumps in dependabot. It must track
engines.node (">=24"), not the newest release — typing the project against a
Node it does not claim to support lets tsc accept APIs that do not exist for
users on the supported version, a type error that only surfaces at their
runtime. migration_guard asserts the pairing, so a major bump lands as red CI on
main; #52 did exactly that and main stayed broken until it was reverted. Minor
and patch updates still flow.
Tests: 823 pass, 0 fail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two loose ends from the LOOP-17 device-auth work.
The denial message
The CLI reported a denial as
authorization denied in the browser— a verdict with no next step, which reads like the account was rejected rather than one request being refused. Denial is recoverable: nothing was authorized, no key was created, and re-running the command starts a fresh request. The message now says so.It also names something the user cannot otherwise know. A device request is bound to nobody until someone acts on it, so any signed-in account that learns a
user_codecan refuse it. A denial the user did not perform therefore means their code reached somebody else — worth telling them while the terminal is still open. This is the CLI half of the accepted-risk note in the 2026-07-28 phishing-resistance spec.Deliberately one line:
formatErrorLineputs its glyph on the first line only, so a multi-line message loses it on every subsequent line. I tried the multi-line version first andlogin.test.tscaught both that and the wording — the final message keeps the existing assertions passing unchanged, which is the right outcome for a test that was guarding real rendering behaviour.The
@types/nodepin@types/nodemust trackengines.node(">=24"), not the newest release. A major bump types the project against a Node it doesn't claim to support, sotscstarts accepting APIs that don't exist for users on the supported version — a type error that only surfaces at their runtime.migration_guardasserts that pairing, so a major bump lands as red CI onmain. #52 did exactly that andmainstayed broken until I reverted it as part of #56. Ignoring majors stops it recurring; minor and patch updates still flow. Raise it deliberately, alongsideengines.node, when the floor actually moves.Test plan
npm run typecheckcleandependabot.ymlparseslogin.test.tsdenial assertions pass without modification🤖 Generated with Claude Code