Rebind the committed project on login instead of forcing project consent

In a checkout whose private project credential had been revoked, `nap
auth login` refreshed only the account login while the dead project
override kept being selected, and attach fell through to a second,
project-scoped browser consent. Login now proves an OAuth project grant
dead (tombstoned, expired, or refresh rejected; unknown outcomes keep
it), selects the account login for this worktree, and attaches the
project named by .napseer/project.json without another consent. A
still-valid override is kept and reported. Attach takes the same fast
path, and a rejected project grant names the recovery step.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
HumbleTurtle
2026-09-28 21:47:36 -03:00
co-authored by Claude Opus 5.5
parent 7eaaffb63f
commit c6bc28442a
3 changed files with 259 additions and 6 deletions
+1 -1
View File
@@ -1093,7 +1093,7 @@ def print_command_help(command):
),
"auth": (
"Usage: nap auth [status|login|repair]\n"
" login Authenticate an account; does not select a project.\n"
" login Authenticate an account and attach the project named by .napseer/project.json.\n"
" status Show credential state without credential values.\n"
" repair Recover failed automatic credential renewal.\n"
" logout [--project] Revoke the selected login.\n"