Skip to content

Commit

Permalink
fix: bug in registration.ErrorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
splaunov committed Mar 31, 2022
1 parent dbf11c4 commit b37b16d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions selfservice/flow/registration/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (s *ErrorHandler) WriteFlowError(
return
}

ds, err := s.d.Config(r.Context()).DefaultIdentityTraitsSchemaURL()
if err != nil {
ds, e := s.d.Config(r.Context()).DefaultIdentityTraitsSchemaURL()
if e != nil {
s.forward(w, r, f, err)
return
}
Expand Down
4 changes: 2 additions & 2 deletions selfservice/strategy/code/registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestRegistration(t *testing.T) {
v.Set("traits.phone", identifier)
}
testhelpers.SubmitRegistrationFormWithFlow(t, true, hc, values,
false, http.StatusBadRequest, publicTS.URL+registration.RouteSubmitFlow, f)
false, http.StatusOK, publicTS.URL+registration.RouteSubmitFlow, f)

messages, err := reg.CourierPersister().NextMessages(context.Background(), 10)
assert.NoError(t, err, "Courier queue should not be empty.")
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestRegistration(t *testing.T) {
v.Set("traits.phone", identifier)
}
body := testhelpers.SubmitRegistrationFormWithFlow(t, isAPI, hc, values,
isSPA, http.StatusBadRequest, expectReturnTo, f)
isSPA, http.StatusOK, expectReturnTo, f)

messages, err := reg.CourierPersister().NextMessages(context.Background(), 10)
assert.NoError(t, err, "Courier queue should not be empty.")
Expand Down

0 comments on commit b37b16d

Please sign in to comment.