fix: encode auth response correctly (when using query in redirect uri)

This commit is contained in:
Livio Amstutz 2022-06-17 13:01:20 +02:00
parent f345ddd0c5
commit 9472f2a009
No known key found for this signature in database
GPG key ID: 26BB1C2FA5952CF0
2 changed files with 32 additions and 10 deletions

View file

@ -77,14 +77,13 @@ func HttpRequest(client *http.Client, req *http.Request, response interface{}) e
return nil
}
func URLEncodeResponse(resp interface{}, encoder Encoder) (string, error) {
func URLEncodeParams(resp interface{}, encoder Encoder) (url.Values, error) {
values := make(map[string][]string)
err := encoder.Encode(resp, values)
if err != nil {
return "", err
return nil, err
}
v := url.Values(values)
return v.Encode(), nil
return values, nil
}
func StartServer(ctx context.Context, port string) {