huskies: merge 724_story_per_account_oauth_credential_storage_with_login_pool
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user