fix: improve OAuth login UX for headless/SSH users
Put the authorization URL front and center instead of treating it as a fallback. Most Hermes users run on remote servers via SSH where webbrowser.open() silently fails.
This commit is contained in:
parent
63e88326a8
commit
b798062501
1 changed files with 9 additions and 4 deletions
|
|
@ -461,18 +461,23 @@ def run_hermes_oauth_login() -> Optional[str]:
|
||||||
auth_url = f"https://claude.ai/oauth/authorize?{urlencode(params)}"
|
auth_url = f"https://claude.ai/oauth/authorize?{urlencode(params)}"
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print("Opening browser for Claude Pro/Max authorization...")
|
print("Authorize Hermes with your Claude Pro/Max subscription.")
|
||||||
print(f"If the browser doesn't open, visit this URL:")
|
print()
|
||||||
|
print("Open this link in your browser:")
|
||||||
|
print()
|
||||||
print(f" {auth_url}")
|
print(f" {auth_url}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
# Try to open browser automatically (works on desktop, silently fails on headless)
|
||||||
try:
|
try:
|
||||||
webbrowser.open(auth_url)
|
webbrowser.open(auth_url)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass # URL printed above as fallback
|
pass
|
||||||
|
|
||||||
|
print("After authorizing, you'll see a code. Paste it below.")
|
||||||
|
print()
|
||||||
try:
|
try:
|
||||||
auth_code = input("Paste the authorization code here: ").strip()
|
auth_code = input("Authorization code: ").strip()
|
||||||
except (KeyboardInterrupt, EOFError):
|
except (KeyboardInterrupt, EOFError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue