Skip to content

Commit

Permalink
fix: missing write in registration error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Aug 25, 2020
1 parent eba8eda commit 3b2af53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selfservice/flow/registration/error.go
Expand Up @@ -128,12 +128,12 @@ func (s *ErrorHandler) WriteFlowError(
return
}

innerRegistrationFlow, innerErr := s.d.RegistrationFlowPersister().GetRegistrationFlow(r.Context(), f.ID)
updatedFlow, innerErr := s.d.RegistrationFlowPersister().GetRegistrationFlow(r.Context(), f.ID)
if innerErr != nil {
s.forward(w, r, innerRegistrationFlow, innerErr)
s.forward(w, r, updatedFlow, innerErr)
}

s.d.Writer().WriteCode(w, r, x.RecoverStatusCode(err, http.StatusBadRequest), innerRegistrationFlow)
s.d.Writer().WriteCode(w, r, x.RecoverStatusCode(err, http.StatusBadRequest), updatedFlow)
}

func (s *ErrorHandler) forward(w http.ResponseWriter, r *http.Request, rr *Flow, err error) {
Expand Down

0 comments on commit 3b2af53

Please sign in to comment.