pass_manager/src/state/get_password.rs
2024-05-13 13:58:56 +03:00

17 lines
367 B
Rust

use crate::prelude::*;
async fn check_password(
_: &Message,
_: &Pool,
locale: LocaleRef,
password: &str,
) -> crate::Result<Option<String>> {
let is_valid = validate_field(password);
if !is_valid {
return Ok(Some(locale.invalid_password.to_owned()));
}
Ok(None)
}
crate::simple_state_handler!(get_password, check_password);