From a6e768fbaf02e6774b598e12b061314c8231b196 Mon Sep 17 00:00:00 2001 From: Krzysztof Bogacki Date: Wed, 20 Sep 2023 14:23:15 +0200 Subject: [PATCH] fix: consider OIDC registration flows errored with duplicate credential 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. --- selfservice/strategy/oidc/strategy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfservice/strategy/oidc/strategy.go b/selfservice/strategy/oidc/strategy.go index 70fa10585d18..8031868f993f 100644 --- a/selfservice/strategy/oidc/strategy.go +++ b/selfservice/strategy/oidc/strategy.go @@ -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{}