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
} 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()
}
}

View File

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