1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-02-13 13:58:38 +02:00

Add validation to recover start

This commit is contained in:
Aaron L 2019-03-06 08:25:30 -08:00
parent 5c92c016e0
commit 4b00b4dd33
2 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix bug with missing imports (thanks @frederikhors)
- Fix bug with inverted remember me checkbox logic
- Fix validation not happening when user commences recovery
### Deprecated

View File

@ -84,6 +84,12 @@ func (r *Recover) StartPost(w http.ResponseWriter, req *http.Request) error {
return err
}
if errs := validatable.Validate(); errs != nil {
logger.Info("recover validation failed")
data := authboss.HTMLData{authboss.DataValidation: authboss.ErrorMap(errs)}
return r.Authboss.Core.Responder.Respond(w, req, http.StatusOK, PageRecoverStart, data)
}
recoverVals := authboss.MustHaveRecoverStartValues(validatable)
user, err := r.Authboss.Storage.Server.Load(req.Context(), recoverVals.GetPID())