Skip to content

Commit

Permalink
fix: sort ui nodes when code is added (PS-144)
Browse files Browse the repository at this point in the history
  • Loading branch information
splaunov committed Nov 22, 2023
1 parent 71ba520 commit 9a120fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions selfservice/strategy/code/strategy_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ func (s *Strategy) Register(w http.ResponseWriter, r *http.Request, f *registrat
return s.handleRegistrationError(w, r, f, &p, err)
}
f.UI.Nodes.Upsert(node.NewInputField("code", "", node.CodeGroup, node.InputAttributeTypeText))
ds, err := s.deps.Config().DefaultIdentityTraitsSchemaURL(r.Context())
if err != nil {
return s.handleRegistrationError(w, r, f, &p, err)
}
if err := registration.SortNodes(r.Context(), f.UI.Nodes, ds.String()); err != nil {
return s.handleRegistrationError(w, r, f, &p, err)
}
return s.handleRegistrationError(w, r, f, &p, NewCodeSentError())
} else {
code, err := s.deps.CodeAuthenticationService().VerifyCode(r.Context(), f, p.Code)
Expand Down

0 comments on commit 9a120fc

Please sign in to comment.