fix: state and auth code response encoding (#185)

* fix: add state in access token response (implicit flow)

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

* fix query param handling
This commit is contained in:
Livio Spring 2022-06-21 07:24:40 +02:00 committed by GitHub
parent c4812dd8de
commit 854e14b7c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 120 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) {