1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-03 00:56:59 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-05-27 03:10:51 -07:00
parent 3359eae306
commit 466d509e34
4 changed files with 9 additions and 9 deletions

@ -32,7 +32,7 @@ type (
}
// KeyAuthValidator defines a function to validate KeyAuth credentials.
KeyAuthValidator func(string, echo.Context) (error, bool)
KeyAuthValidator func(string, echo.Context) (bool, error)
keyExtractor func(echo.Context) (string, error)
)
@ -94,7 +94,7 @@ func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc {
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
}
err, valid := config.Validator(key, c)
valid, err := config.Validator(key, c)
if err != nil {
return err
} else if valid {