From af85669f1c6d69bd19da4b9492e44659b9de0235 Mon Sep 17 00:00:00 2001 From: Darko Luketic Date: Mon, 15 Nov 2021 14:58:15 +0100 Subject: [PATCH] bad copy/paste, changed ginerror.Error field --- gin.go | 7 ++++--- ginerror/type.go | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gin.go b/gin.go index 187f989..a595e58 100644 --- a/gin.go +++ b/gin.go @@ -39,7 +39,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin return } else { errorTypes = append(errorTypes, ginerror.Error{ - Description: options.GetTokenErrorDescription, + Description: string(options.GetTokenErrorDescription), Error: err, }) } @@ -52,7 +52,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin return } else { errorTypes = append(errorTypes, ginerror.Error{ - Description: options.GetTokenErrorDescription, + Description: string(options.ParseTokenErrorDescription), Error: err, }) } @@ -65,7 +65,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin return } else { errorTypes = append(errorTypes, ginerror.Error{ - Description: options.GetTokenErrorDescription, + Description: string(options.ConvertTokenErrorDescription), Error: err, }) } @@ -73,6 +73,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin c.Set(string(opts.ClaimsContextKeyName), tokenClaims) c.Set(string(opts.ErrorsContextKeyName), errorTypes) + c.Next() } } diff --git a/ginerror/type.go b/ginerror/type.go index 76e4a3b..8436bef 100644 --- a/ginerror/type.go +++ b/ginerror/type.go @@ -1,8 +1,6 @@ package ginerror -import "git.icod.de/dalu/oidc/options" - type Error struct { - Description options.ErrorDescription + Description string Error error }