mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
basicauth: default hash to bcrypt (#3050)
The documentation specifies that the hash algorithm defaults to bcrypt. However, the implementation returns an error in provision if no hash is provided. Fix this inconsistency by *actually* defaulting to bcrypt.
This commit is contained in:
parent
dd103a6787
commit
57c6f22684
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ func (HTTPBasicAuth) CaddyModule() caddy.ModuleInfo {
|
|||
// Provision provisions the HTTP basic auth provider.
|
||||
func (hba *HTTPBasicAuth) Provision(ctx caddy.Context) error {
|
||||
if hba.HashRaw == nil {
|
||||
return fmt.Errorf("passwords must be hashed, so a hash must be defined")
|
||||
hba.HashRaw = json.RawMessage(`{"algorithm": "bcrypt"}`)
|
||||
}
|
||||
|
||||
// load password hasher
|
||||
|
|
Loading…
Reference in a new issue