mirror of
https://github.com/labstack/echo.git
synced 2025-06-17 00:17:36 +02:00
@ -15,8 +15,8 @@ func TestKeyAuth(t *testing.T) {
|
||||
res := httptest.NewRecorder()
|
||||
c := e.NewContext(req, res)
|
||||
config := KeyAuthConfig{
|
||||
Validator: func(key string, c echo.Context) (error, bool) {
|
||||
return nil, key == "valid-key"
|
||||
Validator: func(key string, c echo.Context) (bool, error) {
|
||||
return key == "valid-key", nil
|
||||
},
|
||||
}
|
||||
h := KeyAuthWithConfig(config)(func(c echo.Context) error {
|
||||
|
Reference in New Issue
Block a user