summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyauth
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/caddyauth')
-rw-r--r--modules/caddyhttp/caddyauth/command.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/caddyauth/command.go b/modules/caddyhttp/caddyauth/command.go
index c110001..70a11a0 100644
--- a/modules/caddyhttp/caddyauth/command.go
+++ b/modules/caddyhttp/caddyauth/command.go
@@ -56,6 +56,10 @@ func cmdHashPassword(fs caddycmd.Flags) (int, error) {
plaintext := []byte(fs.String("plaintext"))
salt := []byte(fs.String("salt"))
+ if len(plaintext) == 0 {
+ return caddy.ExitCodeFailedStartup, fmt.Errorf("password is required")
+ }
+
var hash []byte
var err error
switch algorithm {