mirror of
https://github.com/labstack/echo.git
synced 2024-11-30 08:46:41 +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
|
||||
g := e.Group("/admin")
|
||||
g.Use(middleware.BasicAuth(func(username, password string) bool {
|
||||
if username == "joe" && password == "secret" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
g.Use(middleware.BasicAuth(func(username, password string, c echo.Context) (error, bool) {
|
||||
if username == "joe" && password == "secret" {
|
||||
return nil, true
|
||||
}
|
||||
return nil, false
|
||||
}))
|
||||
|
||||
// Route level middleware
|
||||
|
Loading…
Reference in New Issue
Block a user