@@ -9,9 +9,11 @@ pub struct Auth {
99 /// Whether or not to require an email on signup.
1010 #[ serde( default = "Auth::default_email_on_signup" ) ]
1111 pub email_on_signup : EmailOnSignup ,
12+
1213 /// The secret key used to sign JWT tokens.
1314 #[ serde( default = "Auth::default_secret_key" ) ]
1415 pub secret_key : SecretKey ,
16+
1517 /// The password constraints
1618 #[ serde( default = "Auth::default_password_constraints" ) ]
1719 pub password_constraints : PasswordConstraints ,
@@ -117,19 +119,19 @@ impl fmt::Display for SecretKey {
117119
118120#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq ) ]
119121pub struct PasswordConstraints {
120- /// The minimum password length.
121- #[ serde( default = "PasswordConstraints::default_min_password_length" ) ]
122- pub min_password_length : usize ,
123122 /// The maximum password length.
124123 #[ serde( default = "PasswordConstraints::default_max_password_length" ) ]
125124 pub max_password_length : usize ,
125+ /// The minimum password length.
126+ #[ serde( default = "PasswordConstraints::default_min_password_length" ) ]
127+ pub min_password_length : usize ,
126128}
127129
128130impl Default for PasswordConstraints {
129131 fn default ( ) -> Self {
130132 Self {
131- min_password_length : Self :: default_min_password_length ( ) ,
132133 max_password_length : Self :: default_max_password_length ( ) ,
134+ min_password_length : Self :: default_min_password_length ( ) ,
133135 }
134136 }
135137}
0 commit comments