feat: add validation for username and password length in user creation
Some checks failed
ci/woodpecker/push/check_fmt Pipeline failed
Some checks failed
ci/woodpecker/push/check_fmt Pipeline failed
This commit is contained in:
parent
4828b7e907
commit
304763fbf8
1 changed files with 2 additions and 0 deletions
|
@ -12,8 +12,10 @@ pub fn setup(cfg: &mut actix_web::web::ServiceConfig) {
|
||||||
|
|
||||||
#[derive(Deserialize, Validate)]
|
#[derive(Deserialize, Validate)]
|
||||||
struct CreateUser {
|
struct CreateUser {
|
||||||
|
#[validate(length(min = 4))]
|
||||||
username: String,
|
username: String,
|
||||||
name: String,
|
name: String,
|
||||||
|
#[validate(length(min = 8))]
|
||||||
password: String,
|
password: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue