update deps, add diagnostics

This commit is contained in:
2024-11-26 23:03:14 +01:00
parent a696b51df2
commit aba3cb4cfd
4 changed files with 53 additions and 74 deletions

View File

@@ -7,6 +7,7 @@ import (
"code.icod.de/dalu/oidc"
"code.icod.de/dalu/oidc/options"
"github.com/davecgh/go-spew/spew"
)
// New returns an OpenID Connect (OIDC) discovery handler (middleware)
@@ -47,12 +48,16 @@ func toHttpHandler(h http.Handler, parseToken oidc.ParseTokenFunc, setters ...op
token, err := parseToken(ctx, tokenString)
if err != nil {
fmt.Println("parseToken error")
spew.Dump(err)
onError(w, opts.ErrorHandler, http.StatusUnauthorized, options.ParseTokenErrorDescription, err)
return
}
tokenClaims, err := token.AsMap(ctx)
if err != nil {
fmt.Println("tokenClaims error")
spew.Dump(err)
onError(w, opts.ErrorHandler, http.StatusUnauthorized, options.ConvertTokenErrorDescription, err)
return
}