diff --git a/src/auth.rs b/src/auth.rs index df46d85..728c1ea 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -23,7 +23,11 @@ pub struct Claims { } /// AuthUser extractor - provides (user_id, email) tuple -pub struct AuthUser(pub String, pub String); +pub struct AuthUser( + pub String, // user_id + #[allow(dead_code)] // email is not used in this simplified version + pub String, // email +); impl FromRequestParts> for Claims { type Rejection = AppError; diff --git a/src/models/folder.rs b/src/models/folder.rs index 4d66673..bda3e15 100644 --- a/src/models/folder.rs +++ b/src/models/folder.rs @@ -30,7 +30,7 @@ impl From for FolderResponse { id: folder.id, name: folder.name, revision_date: folder.updated_at, - object: "folder".to_string(), + object: default_object(), } } } diff --git a/src/models/twofactor.rs b/src/models/twofactor.rs index 04c7d42..4298e3e 100644 --- a/src/models/twofactor.rs +++ b/src/models/twofactor.rs @@ -197,13 +197,4 @@ impl RememberTokenData { created_at: Utc::now().timestamp(), }); } - - /// Check if there are any valid (non-expired) tokens - pub fn has_valid_tokens(&self) -> bool { - let now = Utc::now().timestamp(); - let expiration_seconds = Duration::days(REMEMBER_TOKEN_EXPIRATION_DAYS).num_seconds(); - self.tokens - .iter() - .any(|t| now - t.created_at < expiration_seconds) - } } diff --git a/src/models/user.rs b/src/models/user.rs index dec592e..43550eb 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -144,6 +144,7 @@ pub struct KeyData { pub struct PasswordOrOtpData { #[serde(alias = "MasterPasswordHash")] pub master_password_hash: Option, + #[allow(dead_code)] // OTP verification is not implemented in this simplified version pub otp: Option, }