Translation (WIP)
This commit is contained in:
parent
9b0fcec5e2
commit
e9873c1943
29 changed files with 586 additions and 285 deletions
1
common/src/consts.rs
Normal file
1
common/src/consts.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub const MIN_PASSWORD_SIZE: usize = 8;
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
pub mod consts;
|
||||
pub mod ron_api;
|
||||
pub mod utils;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ use std::sync::LazyLock;
|
|||
|
||||
use regex::Regex;
|
||||
|
||||
use crate::consts;
|
||||
|
||||
pub enum EmailValidation {
|
||||
Ok,
|
||||
NotValid,
|
||||
|
|
@ -28,7 +30,7 @@ pub enum PasswordValidation {
|
|||
}
|
||||
|
||||
pub fn validate_password(password: &str) -> PasswordValidation {
|
||||
if password.len() < 8 {
|
||||
if password.len() < consts::MIN_PASSWORD_SIZE {
|
||||
PasswordValidation::TooShort
|
||||
} else {
|
||||
PasswordValidation::Ok
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue