Skip to content

Commit

Permalink
fix(oidc api webview): check flow messages are set
Browse files Browse the repository at this point in the history
  • Loading branch information
splaunov committed Oct 12, 2022
1 parent 79488d3 commit 9b0ccbd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions selfservice/flow/registration/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ func (s *ErrorHandler) WriteFlowError(
return
}

query := returnTo.Query()

query.Set("code", strconv.Itoa(int(f.UI.Messages[0].ID)))
query.Set("message", f.UI.Messages[0].Text)
returnTo.RawQuery = query.Encode()
if len(f.UI.Messages) > 0 {
query := returnTo.Query()
query.Set("code", strconv.Itoa(int(f.UI.Messages[0].ID)))
query.Set("message", f.UI.Messages[0].Text)
returnTo.RawQuery = query.Encode()
}
returnTo.Path = path.Join(returnTo.Path, "error")
redirectLocation = returnTo.String()

Expand Down

0 comments on commit 9b0ccbd

Please sign in to comment.