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:
parent
5f392f3bb1
commit
badd2efd56
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user