1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-02 08:51:42 +02:00

Update guide.md (#908)

Signature changed for key and basic auth validator

5f392f3bb1
This commit is contained in:
eiji.ienaga 2017-04-19 23:58:49 +09:00 committed by Vishal Rana
parent 5f392f3bb1
commit badd2efd56

View File

@ -214,11 +214,11 @@ e.Use(middleware.Recover())
// Group level middleware // Group level middleware
g := e.Group("/admin") g := e.Group("/admin")
g.Use(middleware.BasicAuth(func(username, password string) bool { g.Use(middleware.BasicAuth(func(username, password string, c echo.Context) (error, bool) {
if username == "joe" && password == "secret" { if username == "joe" && password == "secret" {
return true return nil, true
} }
return false return nil, false
})) }))
// Route level middleware // Route level middleware