Repository navigation
fix(tsmd): report why Touch ID is unavailable instead of "Authenticat… - #24
Merged
Merged
Conversation
…ion required" When LAContext.canEvaluatePolicy fails, no Touch ID prompt is shown, but tsmd returned the same -32002 "Authentication required" as a failed or canceled prompt, and the CLI told the user to authenticate via Touch ID. With the lid closed and no Touch ID keyboard, macOS returns systemCancel and puts the cause only in the debug description, so the user saw no dialog and no reason. Add VaultError.authUnavailable(reason) and RPC error -32004. TouchIDAuth derives the reason from the LAError (lockout, not enrolled, no password, otherwise the debug description). The CLI says no prompt was shown and how to make Touch ID available. The credential-usage skill tells the agent not to retry.
macOS reports "Touch ID is not available in closed clamshell mode" when a Magic Keyboard with Touch ID loses its pairing while the lid is closed. A paired keyboard works with the lid closed, so the lid is not the cause. Connecting the keyboard with a USB cable pairs it again. - tsmd adds the pairing fix to the clamshell reason and does not repeat "Touch ID is not available" when macOS already says it. - The CLI hint for -32004 no longer names a cause. The daemon's reason carries the fix (lockout, enrollment, or pairing). - The credential-usage skill names the pairing cause and matches on "No Touch ID prompt was shown" or code -32004, not on a prefix that the lockout and enrollment messages do not have.
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.
When
LAContext.canEvaluatePolicyfails, macOS does not show a Touch ID prompt. Before this change, tsmd returned the same error as a failed prompt (-32002, "Authentication required"), and the CLI told the user to use Touch ID.One cause: a Magic Keyboard with Touch ID loses its pairing with the Mac while the lid is closed. macOS returns
systemCancel, and its debug text says only "Touch ID is not available in closed clamshell mode." The closed lid is not the cause. A paired keyboard works with the lid closed. To pair the keyboard again, connect it with a USB cable.This change adds
VaultError.authUnavailable(reason)and RPC error -32004.TouchIDAuthgets the reason from theLAError: lockout, no fingerprints enrolled, or no login password. For other errors, it uses the debug text. For the clamshell text, it adds the instruction to pair the keyboard again. The CLI says that no prompt was shown. The credential-usage skill tells the agent not to try again.Related: #25 (password fallback as an unlock policy setting).