Repository navigation
Post the login link for /login while still logged in (2.5.5) - #86
Merged
Merged
Conversation
The login URL watcher only looked for a link while Claude was logged out, so /login to renew a login or switch account (old login still valid) never posted a notification. Look for new links all the time; a link already posted is still never posted again. Dismiss the notification once the saved login has changed (a checksum of the credentials file, so the tokens are never read) and is valid, rather than as soon as any valid login exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6
Owner
|
Thanks, @nsleigh — I reviewed the |
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.
Problem
Running
/loginto renew a login or switch account posted no "Claude Codelogin" notification. The watcher (
scripts/login-url-watcher.sh) onlylooked for a login link while Claude was logged out, and while the old
login is still valid it counts as logged in, so the new link was skipped.
Fix
set of links already posted is unchanged, so a link is still never
posted twice, and old links can't come back after a restart (the tmux
session starts empty).
valid, rather than as soon as any valid login exists (which the old one
already was). The change is spotted with a checksum of
.credentials.json, so the watcher never reads the tokens.DOCS.md: mentions re-running/login, and that the watcher reads thewindow Claude starts in.
If Claude refreshes its token while a
/loginis half done, thenotification can be dismissed early; the link is still in the terminal.
Tests
tests/test-login-url-watcher.shgains a re-login case: logged in, a newlink appears → posted; the credentials don't change → it stays; the new
login is saved → dismissed. It fails on the old watcher. The existing
cases (first login, expiry with the old link in scrollback, a later new
login) still pass, as do the full suite and ShellCheck.
Tested
On Home Assistant OS: in the dev add-on, while logged in,
/loginpostedthe notification, and it cleared once the code was pasted.
🤖 Generated with Claude Code
https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6