1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Signature changed for key and basic auth validator

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-04-18 15:40:28 -07:00
parent c3069d42c1
commit 5f392f3bb1
6 changed files with 20 additions and 14 deletions

View File

@ -15,11 +15,11 @@ func TestBasicAuth(t *testing.T) {
req := httptest.NewRequest(echo.GET, "/", nil)
res := httptest.NewRecorder()
c := e.NewContext(req, res)
f := func(u, p string, c echo.Context) bool {
f := func(u, p string, c echo.Context) (error, bool) {
if u == "joe" && p == "secret" {
return true
return nil, true
}
return false
return nil, false
}
h := BasicAuth(f)(func(c echo.Context) error {
return c.String(http.StatusOK, "test")