Skip to content

Commit 472df59

Browse files
betegonclaude
andcommitted
fix(auth): fix lint errors in rc token hint host matching
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 19b2357 commit 472df59

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/commands/auth/login.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@ function rcTokenHint(
191191
const rcUrl = rcConfig.url
192192
? normalizeOrigin(normalizeUrl(rcConfig.url))
193193
: undefined;
194-
if (rcUrl) {
195-
// rc has an explicit URL — only hint if it matches the current host
196-
if (rcUrl !== normalizeOrigin(effectiveHost)) return;
197-
} else {
198-
// No URL in rc — assume a bare SaaS token; don't hint on self-hosted
199-
if (!isSaaSTrustOrigin(effectiveHost)) return;
194+
// Token is for a different host — don't suggest it
195+
if (rcUrl && rcUrl !== normalizeOrigin(effectiveHost)) {
196+
return;
197+
}
198+
// No URL in rc means a bare SaaS token — don't suggest it for self-hosted
199+
if (!(rcUrl || isSaaSTrustOrigin(effectiveHost))) {
200+
return;
200201
}
201202
// Always include --url for self-hosted instances regardless of how the host
202203
// was supplied — omitting it would point the user at SaaS instead.

0 commit comments

Comments
 (0)