login: missing parameters are 400s

This commit is contained in:
Graham Christensen 2021-04-27 21:10:15 -04:00 committed by Cole Helbling
parent 42ef3b7b72
commit d589db2ed9
No known key found for this signature in database
GPG key ID: B37E0F2371016A4C

View file

@ -27,8 +27,8 @@ sub login_POST {
my $username = $c->stash->{params}->{username} // "";
my $password = $c->stash->{params}->{password} // "";
error($c, "You must specify a user name.") if $username eq "";
error($c, "You must specify a password.") if $password eq "";
badRequest($c, "You must specify a user name.") if $username eq "";
badRequest($c, "You must specify a password.") if $password eq "";
if ($c->get_auth_realm('ldap') && $c->authenticate({username => $username, password => $password}, 'ldap')) {
doLDAPLogin($self, $c, $username);