Skip to content

Commit

Permalink
fix: pass context to registration flow
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 14, 2022
1 parent a1d3254 commit c8d55b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion selfservice/flow/registration/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *ErrorHandler) WriteFlowError(
return
}

if err := SortNodes(f.UI.Nodes, ds.String()); err != nil {
if err := SortNodes(r.Context(), f.UI.Nodes, ds.String()); err != nil {
s.forward(w, r, f, err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion selfservice/flow/registration/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (h *Handler) NewRegistrationFlow(w http.ResponseWriter, r *http.Request, ft
return nil, err
}

if err := SortNodes(f.UI.Nodes, ds.String()); err != nil {
if err := SortNodes(r.Context(), f.UI.Nodes, ds.String()); err != nil {
return nil, err
}

Expand Down
4 changes: 1 addition & 3 deletions selfservice/flow/registration/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"github.com/ory/kratos/ui/node"
)

var ctx = context.Background()

func SortNodes(n node.Nodes, schemaRef string) error {
func SortNodes(ctx context.Context, n node.Nodes, schemaRef string) error {
return n.SortBySchema(ctx,
node.SortBySchema(schemaRef),
node.SortByGroups([]node.Group{
Expand Down

0 comments on commit c8d55b3

Please sign in to comment.