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:
parent
c4812dd8de
commit
854e14b7c4
5 changed files with 120 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue