From 0ff914e90aa4f51d33247a1a5ebff46f1726c054 Mon Sep 17 00:00:00 2001 From: Dave New Date: Sat, 25 Nov 2023 13:12:08 +0200 Subject: [PATCH] chore: formvalue to query get --- runtime/apis/authapi/authorize_endpoint.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/apis/authapi/authorize_endpoint.go b/runtime/apis/authapi/authorize_endpoint.go index 1ad71c191..dc365102e 100644 --- a/runtime/apis/authapi/authorize_endpoint.go +++ b/runtime/apis/authapi/authorize_endpoint.go @@ -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) } @@ -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")) }