Skip to content

Commit 1fd7f35

Browse files
authored
Update guide.md
Signature changed for key and basic auth validator 5f392f3
1 parent 5f392f3 commit 1fd7f35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

website/content/guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ e.Use(middleware.Recover())
214214

215215
// Group level middleware
216216
g := e.Group("/admin")
217-
g.Use(middleware.BasicAuth(func(username, password string) bool {
218-
if username == "joe" && password == "secret" {
219-
return true
220-
}
221-
return false
217+
g.Use(middleware.BasicAuth(func(username, password string, c echo.Context) (error, bool) {
218+
if username == "joe" && password == "secret" {
219+
return nil, true
220+
}
221+
return nil, false
222222
}))
223223

224224
// Route level middleware

0 commit comments

Comments
 (0)