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:
parent
5c92c016e0
commit
4b00b4dd33
@ -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
|
||||
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user