Fix empty json auth parameter bug
@@ -70,13 +70,15 @@ func getAuthentication(flags *pflag.FlagSet, defaults ...*settings.Settings) (se
key := mustGetString(flags, "recaptcha.key")
secret := mustGetString(flags, "recaptcha.secret")
- if key != "" && secret != "" {
+ if key == "" || secret == "" {
+ panic(nerrors.New("you must set the flag 'recaptcha.key' and 'recaptcha.secret' for method 'json'"))
+ }
+
jsonAuth.ReCaptcha = &auth.ReCaptcha{
Host: host,
Key: key,
Secret: secret,
}
- }
auther = jsonAuth
}
