huskies: merge 724_story_per_account_oauth_credential_storage_with_login_pool

This commit is contained in:
dave
2026-04-27 17:36:00 +00:00
parent ed8646f0d9
commit 1ecb4dad55
5 changed files with 265 additions and 33 deletions
+7 -8
View File
@@ -93,16 +93,15 @@ pub async fn oauth_callback(
}
}
/// `GET /oauth/status` — Check whether valid (non-expired) OAuth credentials exist.
/// `GET /oauth/status` — Return status for all stored OAuth accounts in the login pool.
///
/// Each entry includes the account email, status (`active`, `expired`, or
/// `rate-limited`), expiry timestamp, and refresh-token presence flag.
/// Returns an empty `accounts` array when no accounts are stored.
#[handler]
pub async fn oauth_status() -> poem::Response {
let status = svc::check_status();
let body = serde_json::json!({
"authenticated": status.authenticated,
"expired": status.expired,
"expires_at": status.expires_at,
"has_refresh_token": status.has_refresh_token,
});
let accounts = svc::check_all_accounts();
let body = serde_json::json!({ "accounts": accounts });
poem::Response::builder()
.status(StatusCode::OK)
.header("Content-Type", "application/json")