Skip to content

Commit

Permalink
fix: Change name struct to UpperCase
Browse files Browse the repository at this point in the history
  • Loading branch information
juandiii committed Jun 25, 2020
1 parent a4a749e commit a403934
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func JwtMiddleware(config ...Config) func(*fiber.Ctx) {
}
}

if cfg.keyFunc == nil {
// cfg.keyFunc = cfg.keyFunc
if cfg.KeyFunc == nil {
// cfg.KeyFunc = cfg.KeyFunc
}

parts := strings.Split(headers, ":")
Expand All @@ -61,11 +61,11 @@ func JwtMiddleware(config ...Config) func(*fiber.Ctx) {
token := new(jwt.Token)

if _, ok := cfg.Claims.(jwt.MapClaims); ok {
token, err = jwt.Parse(auth, cfg.keyFunc)
token, err = jwt.Parse(auth, cfg.KeyFunc)
} else {
t := reflect.ValueOf(cfg.Claims).Type().Elem()
claims := reflect.New(t).Interface().(jwt.Claims)
token, err = jwt.ParseWithClaims(auth, claims, cfg.keyFunc)
token, err = jwt.ParseWithClaims(auth, claims, cfg.KeyFunc)
}

if err == nil && token.Valid {
Expand Down

0 comments on commit a403934

Please sign in to comment.