my $password = $body->{password} // "";
return try {
my ( $status, $cardnumber, $userid ) = C4::Auth::checkpw( $identifier, $password );
my ( $status, $THE_cardnumber, $THE_userid ) = C4::Auth::checkpw( $identifier, $password );
unless ($status) {
return $c->render(
status => 400,
);
}
return $c->render( status => 204, openapi => '' );
status => 201,
openapi => {
cardnumber => $THE_cardnumber,
userid => $THE_userid,
catch {
if ( blessed $_ and $_->isa('Koha::Exceptions::Password') ) {
produces:
- application/json
responses:
"204":
"201":
description: Validation successful
schema:
type: object
properties:
cardnumber:
type: string
description: cardnumber for the validated patron
userid:
description: userid for the validated patron
additionalProperties: false
"400":
description: Bad request
-