Add mixxing Recovery field on User object
This commit is contained in:
@@ -12,9 +12,10 @@ import (
|
||||
type User struct {
|
||||
Username string
|
||||
Password string
|
||||
Email string
|
||||
CreatedAt time.Time
|
||||
|
||||
Recovery string `default:"auto"`
|
||||
|
||||
Tokens []string `default:"[]"`
|
||||
}
|
||||
|
||||
|
||||
@@ -26,13 +26,6 @@ func (s *Server) ResetPasswordHandler() httprouter.Handle {
|
||||
email := strings.TrimSpace(r.FormValue("email"))
|
||||
recovery := fmt.Sprintf("email:%s", FastHash(email))
|
||||
|
||||
if err := ValidateUsername(username); err != nil {
|
||||
ctx.Error = true
|
||||
ctx.Message = fmt.Sprintf("Username validation failed: %s", err.Error())
|
||||
s.render("error", w, ctx)
|
||||
return
|
||||
}
|
||||
|
||||
// Check if user exist
|
||||
if !s.db.HasUser(username) {
|
||||
ctx.Error = true
|
||||
|
||||
Reference in New Issue
Block a user