fix: password must at least 8 char in lenght
Docker Build and Push / Build and Push Docker Image (push) Successful in 13m23s
Docker Build and Push / Build and Push Docker Image (push) Successful in 13m23s
This commit is contained in:
@@ -43,6 +43,11 @@ func (h *Handler) RegisterPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(register.Password) < 8 {
|
||||||
|
badRequest(w, errors.New("password must be at least 8 characters long"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
hashedPassword, err := bcrypt.GenerateFromPassword(
|
hashedPassword, err := bcrypt.GenerateFromPassword(
|
||||||
[]byte(register.Password),
|
[]byte(register.Password),
|
||||||
bcrypt.DefaultCost,
|
bcrypt.DefaultCost,
|
||||||
|
|||||||
Reference in New Issue
Block a user