parent
895615ad6e
commit
5d7b540718
15 changed files with 71 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
package webui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
|
||||
|
@ -66,6 +67,14 @@ func handleAccountsIdResetPasswordPOST(db *database.DB) http.Handler {
|
|||
if account == nil {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
errorResponse(w, r, http.StatusBadRequest,
|
||||
fmt.Errorf("failed to parse form: %w", err))
|
||||
return
|
||||
}
|
||||
if !verifyCSRFToken(w, r) {
|
||||
return
|
||||
}
|
||||
password := r.FormValue("password")
|
||||
if len(password) < 8 {
|
||||
errorResponse(w, r, http.StatusBadRequest, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue