Fix empty json auth parameter bug
This commit is contained in:
parent
6e48a6b512
commit
748e4acfb6
|
@ -70,12 +70,14 @@ func getAuthentication(flags *pflag.FlagSet, defaults ...*settings.Settings) (se
|
||||||
key := mustGetString(flags, "recaptcha.key")
|
key := mustGetString(flags, "recaptcha.key")
|
||||||
secret := mustGetString(flags, "recaptcha.secret")
|
secret := mustGetString(flags, "recaptcha.secret")
|
||||||
|
|
||||||
if key != "" && secret != "" {
|
if key == "" || secret == "" {
|
||||||
jsonAuth.ReCaptcha = &auth.ReCaptcha{
|
panic(nerrors.New("you must set the flag 'recaptcha.key' and 'recaptcha.secret' for method 'json'"))
|
||||||
Host: host,
|
}
|
||||||
Key: key,
|
|
||||||
Secret: secret,
|
jsonAuth.ReCaptcha = &auth.ReCaptcha{
|
||||||
}
|
Host: host,
|
||||||
|
Key: key,
|
||||||
|
Secret: secret,
|
||||||
}
|
}
|
||||||
|
|
||||||
auther = jsonAuth
|
auther = jsonAuth
|
||||||
|
|
Loading…
Reference in New Issue