Skip to main content

Module oauth

Module oauth 

Source

Structs§

AuthInfo
Stored authentication data
LoginSession
In-flight OAuth session. Returned by start_login(). The caller drives the flow:
UserInfo

Enums§

PollOutcome
Outcome of one LoginSession::poll_once call.

Functions§

auth_file_path
Get path to auth file
authorize_url
current_user
Get current user info (if logged in)
get_stored_auth
Get stored auth info
get_valid_token
Get a valid access token, refreshing automatically if expired. Returns the access token string ready to use.
is_logged_in
Check if user is logged in
login
Stdout-driven OAuth login: prints the URL, opens the browser, polls /auth/check with stdin-driven ESC cancel. Used by the CLI (atomcode login, atomcode codingplan) and by setup.rs’s step_login when the TUI hasn’t already pre-flighted login.
logout
Logout - clear stored auth.
open_browser
platform_broker_url
Platform server URLs (derived from ATOMCODE_PLATFORM_SERVER).
platform_check_url
platform_exchange_url
platform_login_url
platform_refresh_url
platform_token_url
refresh_access_token
Refresh the access token using the stored refresh_token via Platform Broker. Returns updated AuthInfo with new tokens, and saves it to disk.
save_auth
Save auth info to file
start_login
Begin OAuth login: call /auth/login, return a session containing the auth URL + state. Cheap (one HTTP round-trip), never blocks on user action — separated from polling so callers can render the URL before yielding control to the wait loop.
token_url
user_url