@@ -, +, @@ error --- Koha/REST/V1/Auth/Password.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/Koha/REST/V1/Auth/Password.pm +++ a/Koha/REST/V1/Auth/Password.pm @@ -41,7 +41,7 @@ Controller method that checks a patron's password sub validate { my $c = shift->openapi->valid_input or return; - my $body = $c->req->json; + my $body = $c->req->json; my $identifier = $body->{identifier}; my $userid = $body->{userid}; @@ -72,10 +72,11 @@ sub validate { return try { my ( $status, $THE_cardnumber, $THE_userid ) = C4::Auth::checkpw( $identifier, $password ); - unless ($status) { + unless ( $status && $status > 0 ) { + my $error_response = $status == -2 ? 'Password expired' : 'Validation failed'; return $c->render( status => 400, - openapi => { error => "Validation failed" } + openapi => { error => $error_response } ); } --