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:
@ -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")
|
||||
|
Reference in New Issue
Block a user