Detect Grok's grok login OAuth as auth - #44
Merged
Merged
Conversation
`grok login` (device OAuth) writes ~/.grok/auth.json and authenticates headless against the subscription proxy - so a user who logs in through the setup wizard is genuinely ready. But authed() only checked XAI_API_KEY, so a just-logged-in grok was reported "not signed in" and skipped, contradicting the login that just succeeded. auth.json is written only on login (not on install, unlike the ~/.grok dir), so it is a safe signal. Recognise it, and point the auth hints at `grok login` as a first-class option alongside the API key.
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.
Surfaced by the freshly-shipped
setupwizard:grok login(device OAuth) succeeds ("Signed in as …"), writes~/.grok/auth.json, and authenticates headless against the subscription proxy — butauthed()only checkedXAI_API_KEY, so postmortemthis reported grok as "not signed in" and skipped it, directly contradicting the login that just completed.auth.jsonis written only on login (not on install, unlike the~/.grokdir), so it's a safe signal. Nowauthed()accepts either~/.grok/auth.jsonorXAI_API_KEY, and the auth/fix hints mentiongrok loginas a first-class option.Verified: after
grok login,doctornow showsgrok — signed in (grok login or XAI_API_KEY). (A logged-in account still needs Grok credits/SuperGrok to actually run — that's a 403 billing wall, not an auth failure.)