Skip to content

Commit

Permalink
Fix empty json auth parameter bug
Browse files Browse the repository at this point in the history
  • Loading branch information
unicod3 committed May 19, 2019
1 parent 6e48a6b commit 748e4ac
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmd/config.go
Expand Up @@ -70,12 +70,14 @@ func getAuthentication(flags *pflag.FlagSet, defaults ...*settings.Settings) (se
key := mustGetString(flags, "recaptcha.key")
secret := mustGetString(flags, "recaptcha.secret")

if key != "" && secret != "" {
jsonAuth.ReCaptcha = &auth.ReCaptcha{
Host: host,
Key: key,
Secret: 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
Expand Down

0 comments on commit 748e4ac

Please sign in to comment.