mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 16:37:46 +08:00
fix(oauth): 修复 OAuth 刷新后 Token 有效期不更新问题 (#324)
- 持久化刷新后的 `expires_at` 到 Provider Key SQL 更新链路 - 手动刷新接口优先返回本次刷新得到的过期时间 - 按当前 Key 字段重建 OAuth 状态快照,避免旧快照覆盖 - 前端刷新后防止旧列表数据回退覆盖新有效期
This commit is contained in:
@@ -121,6 +121,10 @@ fn admin_pool_derive_oauth_expires_at(
|
||||
return None;
|
||||
}
|
||||
|
||||
if key.expires_at_unix_secs.is_some() {
|
||||
return key.expires_at_unix_secs;
|
||||
}
|
||||
|
||||
for field in ["expires_at", "expiresAt", "expiry", "exp"] {
|
||||
let expires_at = admin_pool_json_to_u64(auth_config.and_then(|config| config.get(field)));
|
||||
if expires_at.is_some() {
|
||||
@@ -128,7 +132,7 @@ fn admin_pool_derive_oauth_expires_at(
|
||||
}
|
||||
}
|
||||
|
||||
key.expires_at_unix_secs
|
||||
None
|
||||
}
|
||||
|
||||
fn admin_pool_derive_oauth_plan_type(
|
||||
|
||||
Reference in New Issue
Block a user