Skip to content

Commit 8ddc90d

Browse files
Correcting the BasicAuth Method
Current method gives type error because `context` variable is not present. Adding the `c echo.Context` for resolving type error.
1 parent 736d153 commit 8ddc90d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/content/middleware/basic-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Basic auth middleware provides an HTTP basic authentication.
1515
*Usage*
1616

1717
```go
18-
e.Use(middleware.BasicAuth(func(username, password string) bool {
18+
e.Use(middleware.BasicAuth(func(username, password string, c echo.Context) bool {
1919
if username == "joe" && password == "secret" {
2020
return true
2121
}

0 commit comments

Comments
 (0)