Explorar el Código

auth: reject empty signing method for JWT token provider

Anthony Romano hace 8 años
padre
commit
fe727f3106
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      auth/jwt.go

+ 3 - 1
auth/jwt.go

@@ -97,7 +97,9 @@ func prepareOpts(opts map[string]string) (jwtSignMethod, jwtPubKeyPath, jwtPrivK
 			return "", "", "", ErrInvalidAuthOpts
 		}
 	}
-
+	if len(jwtSignMethod) == 0 {
+		return "", "", "", ErrInvalidAuthOpts
+	}
 	return jwtSignMethod, jwtPubKeyPath, jwtPrivKeyPath, nil
 }