mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 18:37:46 +08:00
Distinguish expired OAuth token status
This commit is contained in:
@@ -376,9 +376,6 @@ fn oauth_invalid_reason_blocks_scheduling(
|
||||
now_unix_secs: u64,
|
||||
) -> bool {
|
||||
let trimmed_reason = invalid_reason.trim();
|
||||
if oauth_invalid_reason_has_tag(trimmed_reason, "[OAUTH_EXPIRED]") {
|
||||
return true;
|
||||
}
|
||||
|
||||
let account_state = admin_provider_status_pure::resolve_pool_account_state(
|
||||
Some(provider_type),
|
||||
@@ -433,6 +430,7 @@ fn oauth_account_state_code_is_hard_block(code: &str) -> bool {
|
||||
| "account_forbidden"
|
||||
| "account_blocked"
|
||||
| "account_verification"
|
||||
| "oauth_token_invalid"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -2064,7 +2064,7 @@ async fn keeps_codex_candidate_selectable_when_oauth_token_is_expired() {
|
||||
let mut key = sample_key("key-codex", "provider-codex", Some(10));
|
||||
key.auth_type = "oauth".to_string();
|
||||
key.oauth_invalid_at_unix_secs = Some(1_710_000_000);
|
||||
key.oauth_invalid_reason = Some("Codex Token 无效或已过期".to_string());
|
||||
key.oauth_invalid_reason = Some("[OAUTH_EXPIRED] session expired".to_string());
|
||||
key
|
||||
}],
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user