fix: Change device_code interval from i64 to i32

The migration creates the interval column as integer (INT4) but the
entity and storage struct used i64 (INT8), causing a type mismatch
error on PostgreSQL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Till Wegmueller 2026-02-22 18:33:50 +01:00
parent f6262b2128
commit 210a27ca02
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ pub struct Model {
pub created_at: i64,
pub expires_at: i64,
pub last_poll_at: Option<i64>,
pub interval: i64,
pub interval: i32,
pub status: String, // "pending" | "approved" | "denied" | "consumed"
pub subject: Option<String>,
pub auth_time: Option<i64>,

View file

@ -103,7 +103,7 @@ pub struct DeviceCode {
pub created_at: i64,
pub expires_at: i64,
pub last_poll_at: Option<i64>,
pub interval: i64,
pub interval: i32,
pub status: String, // "pending" | "approved" | "denied" | "consumed"
pub subject: Option<String>,
pub auth_time: Option<i64>,

View file

@ -1695,7 +1695,7 @@ async fn handle_device_code_grant(
let now = chrono::Utc::now().timestamp();
let elapsed = now - last_poll;
if elapsed < device_code.interval {
if elapsed < device_code.interval as i64 {
// Polling too fast - increment interval and return slow_down
let _ = storage::increment_device_code_interval(&state.db, &device_code_str).await;