You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: session expires after ~1 hour due to OAuth client_id mismatch on token refresh #63
When using the CLI, sessions expire after approximately 1 hour. Running any command after that shows "Not logged in" even though the user previously authenticated successfully.
Root cause
The OAuth client_id for loopback clients includes the redirect URI with the port number. During sb login, a random free port is used (e.g., 54321), producing a client_id like:
This produces a different client_id. When the access token expires (~1 hour TTL from the PDS) and the OAuth library tries to use the refresh token, the PDS rejects the request because the client_id doesn't match the one used during authorization.
Steps to reproduce
sb login <handle> — authenticate via browser
Use any command (e.g., sb cards) — works fine
Wait ~1 hour for the access token to expire
Run any command again — fails with "Not logged in"
Fix
Store the port used during login in session.json and reuse it when creating the NodeOAuthClient for session restoration. This keeps the client_id consistent so token refresh works correctly.
Activity