mirror of
https://github.com/labstack/echo.git
synced 2025-07-05 00:58:47 +02:00
@ -23,7 +23,7 @@ type (
|
||||
}
|
||||
|
||||
// BasicAuthValidator defines a function to validate BasicAuth credentials.
|
||||
BasicAuthValidator func(string, string, echo.Context) (error, bool)
|
||||
BasicAuthValidator func(string, string, echo.Context) (bool, error)
|
||||
)
|
||||
|
||||
const (
|
||||
@ -81,7 +81,7 @@ func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc {
|
||||
for i := 0; i < len(cred); i++ {
|
||||
if cred[i] == ':' {
|
||||
// Verify credentials
|
||||
err, valid := config.Validator(cred[:i], cred[i+1:], c)
|
||||
valid, err := config.Validator(cred[:i], cred[i+1:], c)
|
||||
if err != nil {
|
||||
return err
|
||||
} else if valid {
|
||||
|
Reference in New Issue
Block a user