fix(auth): tell a refused Keychain apart from a missing login - #43
Merged
Conversation
Pressing n on the lcc open dashboard answered "Not authenticated. Run `lcc auth` first." while the token sat in the Keychain, valid, and then took the dashboard down with it. oauth.getToken collapsed three answers into one null: nothing stored, a Keychain that refused the read, and a stored value that will not parse. Only the first means the user has to authenticate. The refusal is the likeliest of the three on a machine that rebuilds lcc, because a renewed signing certificate changes the designated requirement and macOS asks once more — a dialog that can be denied, escaped, or missed behind a full-screen terminal. Sending that user through a browser round trip fixes it only by accident. readToken separates the three, and keychain.describeLast, which nothing had ever called, names the OSStatus so the next occurrence is diagnosable from the one line it prints. The second failure is that start.bail exited the process. lcc open runs start.run in-process for n and catches its errors precisely so the dashboard survives, so one bad answer ended every other session's row along with the picker. bail now returns error.Failed under returns_to_caller, the flag cancel already used for the same reason.
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.
lcc open→nanswered "Not authenticated. Runlcc authfirst." while the token sat in the Keychain, valid, and then exited the process, taking every other session's row down with the picker.oauth.readTokennow separates nothing stored from the Keychain refused the read (naming the OSStatus, via akeychain.describeLastthat nothing had ever called) and from a stored value that will not parse;start.bailreturnserror.Failedinstead of exiting when the dashboard is its caller.