mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	Min passwordlength =6
This commit is contained in:
		
							parent
							
								
									32f28d664e
								
							
						
					
					
						commit
						5cea214fd9
					
				@ -23,7 +23,7 @@ pub struct LoginForm {
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(length(min = 1, message = "Missing username"))]
 | 
			
		||||
    username: String,
 | 
			
		||||
    #[validate(length(min = 8, message = "Invalid password. Min length: 8"))]
 | 
			
		||||
    #[validate(length(min = 6, message = "Invalid password. Min length: 6"))]
 | 
			
		||||
    password: String,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@ use yew_router::{
 | 
			
		||||
/// The fields of the form, with the constraints.
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(length(min = 8, message = "Invalid password. Min length: 8"))]
 | 
			
		||||
    #[validate(length(min = 6, message = "Invalid password. Min length: 6"))]
 | 
			
		||||
    password: String,
 | 
			
		||||
    #[validate(must_match(other = "password", message = "Passwords must match"))]
 | 
			
		||||
    confirm_password: String,
 | 
			
		||||
 | 
			
		||||
@ -23,8 +23,8 @@ mod infra;
 | 
			
		||||
async fn create_admin_user(handler: &SqlBackendHandler, config: &Configuration) -> Result<()> {
 | 
			
		||||
    let pass_length = config.ldap_user_pass.unsecure().len();
 | 
			
		||||
    assert!(
 | 
			
		||||
        pass_length >= 8,
 | 
			
		||||
        "Minimum password length is 8 characters, got {} characters",
 | 
			
		||||
        pass_length >= 6,
 | 
			
		||||
        "Minimum password length is 6 characters, got {} characters",
 | 
			
		||||
        pass_length
 | 
			
		||||
    );
 | 
			
		||||
    handler
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user