chroe: remove unused code and suppress warnings
This commit is contained in:
parent
fc3cd06f30
commit
2591e2e46f
4 changed files with 7 additions and 11 deletions
|
|
@ -23,7 +23,11 @@ pub struct Claims {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// AuthUser extractor - provides (user_id, email) tuple
|
/// 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<Arc<Env>> for Claims {
|
impl FromRequestParts<Arc<Env>> for Claims {
|
||||||
type Rejection = AppError;
|
type Rejection = AppError;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ impl From<Folder> for FolderResponse {
|
||||||
id: folder.id,
|
id: folder.id,
|
||||||
name: folder.name,
|
name: folder.name,
|
||||||
revision_date: folder.updated_at,
|
revision_date: folder.updated_at,
|
||||||
object: "folder".to_string(),
|
object: default_object(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,13 +197,4 @@ impl RememberTokenData {
|
||||||
created_at: Utc::now().timestamp(),
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ pub struct KeyData {
|
||||||
pub struct PasswordOrOtpData {
|
pub struct PasswordOrOtpData {
|
||||||
#[serde(alias = "MasterPasswordHash")]
|
#[serde(alias = "MasterPasswordHash")]
|
||||||
pub master_password_hash: Option<String>,
|
pub master_password_hash: Option<String>,
|
||||||
|
#[allow(dead_code)] // OTP verification is not implemented in this simplified version
|
||||||
pub otp: Option<String>,
|
pub otp: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue