Skip to content

fix: expose actionable session details in login --json#334

Merged
manojbajaj95 merged 3 commits into
mainfrom
bugfix/login-json-session-details
May 25, 2026
Merged

fix: expose actionable session details in login --json#334
manojbajaj95 merged 3 commits into
mainfrom
bugfix/login-json-session-details

Conversation

@ankitranjan7
Copy link
Copy Markdown
Collaborator

Description

Expose actionable session details in authsome login --json for interactive login flows. The CLI now includes session_id and auth_url when a login session starts, and it also surfaces device-code fields like user_code, verification_uri, and verification_uri_complete when the server has them available.

Motivation and Context

Issue #320 reports that authsome login --json only returns a minimal status payload even though the runtime already knows the session ID and next action. That makes interactive flows much harder for agents and other programmatic clients, which should not have to scrape terminal text or rely on webbrowser.open(...).

This change fixes that contract gap by preserving actionable session metadata in JSON mode while leaving the non-JSON behavior unchanged.

Fixes #320.

How Has This Been Tested?

Ran:

  • uv run pytest
  • uv run ruff check src/ tests/
  • uv run ty check src/
  • uv run --with pre-commit pre-commit run --all-files

Also added regression coverage for:

  • OAuth-style login --json responses exposing session_id and auth_url
  • Device-code login --json responses exposing session_id, auth_url, user_code, verification_uri, and verification_uri_complete
  • Server session responses exposing device-code metadata to the CLI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@manojbajaj95 manojbajaj95 merged commit 87ae0b7 into main May 25, 2026
3 checks passed
@manojbajaj95 manojbajaj95 deleted the bugfix/login-json-session-details branch May 25, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AX] authsome login --json omits actionable session details for interactive login flows

2 participants