bad copy/paste, changed ginerror.Error field

This commit is contained in:
Darko Luketic 2021-11-15 14:58:15 +01:00
parent 0ef4602dec
commit af85669f1c
2 changed files with 5 additions and 6 deletions

7
gin.go
View File

@ -39,7 +39,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin
return return
} else { } else {
errorTypes = append(errorTypes, ginerror.Error{ errorTypes = append(errorTypes, ginerror.Error{
Description: options.GetTokenErrorDescription, Description: string(options.GetTokenErrorDescription),
Error: err, Error: err,
}) })
} }
@ -52,7 +52,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin
return return
} else { } else {
errorTypes = append(errorTypes, ginerror.Error{ errorTypes = append(errorTypes, ginerror.Error{
Description: options.GetTokenErrorDescription, Description: string(options.ParseTokenErrorDescription),
Error: err, Error: err,
}) })
} }
@ -65,7 +65,7 @@ func toGinHandler(parseToken oidc.ParseTokenFunc, setters ...options.Option) gin
return return
} else { } else {
errorTypes = append(errorTypes, ginerror.Error{ errorTypes = append(errorTypes, ginerror.Error{
Description: options.GetTokenErrorDescription, Description: string(options.ConvertTokenErrorDescription),
Error: err, 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.ClaimsContextKeyName), tokenClaims)
c.Set(string(opts.ErrorsContextKeyName), errorTypes) c.Set(string(opts.ErrorsContextKeyName), errorTypes)
c.Next() c.Next()
} }
} }

View File

@ -1,8 +1,6 @@
package ginerror package ginerror
import "git.icod.de/dalu/oidc/options"
type Error struct { type Error struct {
Description options.ErrorDescription Description string
Error error Error error
} }