Skip to content

Commit

Permalink
chore: formvalue to query get
Browse files Browse the repository at this point in the history
  • Loading branch information
davenewza committed Nov 25, 2023
1 parent dd88be6 commit 0ff914e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/apis/authapi/authorize_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func CallbackHandler(schema *proto.Schema) common.HandlerFunc {
}

// If the auth provider errored, then package this up and send it as an error with the redirectUrl
if callbackError := r.FormValue("error"); callbackError != "" {
err := fmt.Errorf("provider error: %s. %s", callbackError, r.FormValue("error_description"))
if callbackError := r.URL.Query().Get("error"); callbackError != "" {
err := fmt.Errorf("provider error: %s. %s", callbackError, r.URL.Query().Get("error_description"))
return redirectErrResponse(ctx, redirectUrl, AuthorizationErrAccessDenied, err.Error(), err)
}

Expand Down Expand Up @@ -182,8 +182,8 @@ func CallbackHandler(schema *proto.Schema) common.HandlerFunc {
RedirectURL: callbackUrl.String(),
}

code := r.FormValue("code")
if !r.Form.Has("code") || code == "" {
code := r.URL.Query().Get("code")
if code == "" {
return common.InternalServerErrorResponse(ctx, errors.New("code not returned with callback url"))
}

Expand Down

0 comments on commit 0ff914e

Please sign in to comment.