fix(saas): SQL type cast fixes for E2E relay flow
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- key_pool.rs: cast cooldown_until to timestamptz for comparison with NOW()
- key_pool.rs: cast request_count to bigint (INT4→INT8) for sqlx decoding
- service.rs: cast cooldown_until to timestamptz in quota sort query
- scheduler.rs: cast last_seen_at to timestamptz in device cleanup
- totp.rs: use DateTime<Utc> instead of rfc3339 string for updated_at
This commit is contained in:
iven
2026-04-07 22:24:19 +08:00
parent ca0e537682
commit f9303ae0c3
4 changed files with 7 additions and 7 deletions

View File

@@ -226,7 +226,7 @@ pub async fn verify_totp(
encrypt_totp_secret(&secret, &enc_key)?
};
let now_ts = chrono::Utc::now().to_rfc3339();
let now_ts = chrono::Utc::now();
sqlx::query("UPDATE accounts SET totp_enabled = true, totp_secret = $1, updated_at = $2 WHERE id = $3")
.bind(&final_secret)
.bind(&now_ts)
@@ -260,7 +260,7 @@ pub async fn disable_totp(
}
// 清除 TOTP
let now = chrono::Utc::now().to_rfc3339();
let now = chrono::Utc::now();
sqlx::query("UPDATE accounts SET totp_enabled = false, totp_secret = NULL, updated_at = $1 WHERE id = $2")
.bind(&now)
.bind(&ctx.account_id)