fix parse
This commit is contained in:
parent
7069813ec7
commit
0fe7c3307f
2 changed files with 5 additions and 5 deletions
|
@ -153,15 +153,15 @@ type clientData struct {
|
||||||
// If no client id can be obtained by any method, oidc.ErrInvalidClient
|
// If no client id can be obtained by any method, oidc.ErrInvalidClient
|
||||||
// is returned with ErrMissingClientID wrapped in it.
|
// is returned with ErrMissingClientID wrapped in it.
|
||||||
func ClientIDFromRequest(r *http.Request, p ClientProvider) (clientID string, authenticated bool, err error) {
|
func ClientIDFromRequest(r *http.Request, p ClientProvider) (clientID string, authenticated bool, err error) {
|
||||||
ctx, span := tracer.Start(r.Context(), "ClientIDFromRequest")
|
|
||||||
r = r.WithContext(ctx)
|
|
||||||
defer span.End()
|
|
||||||
|
|
||||||
err = r.ParseForm()
|
err = r.ParseForm()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", false, oidc.ErrInvalidRequest().WithDescription("cannot parse form").WithParent(err)
|
return "", false, oidc.ErrInvalidRequest().WithDescription("cannot parse form").WithParent(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, span := tracer.Start(r.Context(), "ClientIDFromRequest")
|
||||||
|
r = r.WithContext(ctx)
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
data := new(clientData)
|
data := new(clientData)
|
||||||
if err = p.Decoder().Decode(data, r.Form); err != nil {
|
if err = p.Decoder().Decode(data, r.Form); err != nil {
|
||||||
return "", false, err
|
return "", false, err
|
||||||
|
|
|
@ -181,7 +181,7 @@ func TestRoutes(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// This call will fail. A successfull test is already
|
// This call will fail. A successful test is already
|
||||||
// part of client/integration_test.go
|
// part of client/integration_test.go
|
||||||
name: "code exchange",
|
name: "code exchange",
|
||||||
method: http.MethodGet,
|
method: http.MethodGet,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue