Skip to content

Commit

Permalink
fix: consider OIDC registration flows errored with duplicate credenti…
Browse files Browse the repository at this point in the history
…al to be completed by strategy

Returning anything else here may cause Kratos to respond with two concatenated JSON objects: new login flow with actual error message as the first one and a very confusing '500, aborted registration hook execution' as the second one.
  • Loading branch information
Saancreed committed Sep 28, 2023
1 parent 6b91dc1 commit f882ad2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfservice/strategy/oidc/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func (s *Strategy) handleError(w http.ResponseWriter, r *http.Request, f flow.Fl
// return a new login flow with the error message embedded in the login flow.
x.AcceptToRedirectOrJSON(w, r, s.d.Writer(), lf, lf.AppendTo(s.d.Config().SelfServiceFlowLoginUI(r.Context())).String())
// ensure the function does not continue to execute
return registration.ErrHookAbortFlow
return flow.ErrCompletedByStrategy
}

rf.UI.Nodes = node.Nodes{}
Expand Down

0 comments on commit f882ad2

Please sign in to comment.