View | Details | Raw Unified | Return to bug 34313
Collapse All | Expand All

(-)a/Koha/REST/V1/Auth/Password.pm (-2 / +8 lines)
Lines 65-71 sub validate { Link Here
65
    my $password = $body->{password} // "";
65
    my $password = $body->{password} // "";
66
66
67
    return try {
67
    return try {
68
        my ( $status, $cardnumber, $userid ) = C4::Auth::checkpw( $identifier, $password );
68
        my ( $status, $THE_cardnumber, $THE_userid ) = C4::Auth::checkpw( $identifier, $password );
69
        unless ($status) {
69
        unless ($status) {
70
            return $c->render(
70
            return $c->render(
71
                status  => 400,
71
                status  => 400,
Lines 73-79 sub validate { Link Here
73
            );
73
            );
74
        }
74
        }
75
75
76
        return $c->render( status => 204, openapi => '' );
76
        return $c->render(
77
            status  => 201,
78
            openapi => {
79
                cardnumber => $THE_cardnumber,
80
                userid     => $THE_userid,
81
            }
82
        );
77
    }
83
    }
78
    catch {
84
    catch {
79
        if ( blessed $_ and $_->isa('Koha::Exceptions::Password') ) {
85
        if ( blessed $_ and $_->isa('Koha::Exceptions::Password') ) {
(-)a/api/v1/swagger/paths/auth.yaml (-2 / +11 lines)
Lines 1091-1098 Link Here
1091
    produces:
1091
    produces:
1092
      - application/json
1092
      - application/json
1093
    responses:
1093
    responses:
1094
      "204":
1094
      "201":
1095
        description: Validation successful
1095
        description: Validation successful
1096
        schema:
1097
          type: object
1098
          properties:
1099
            cardnumber:
1100
              type: string
1101
              description: cardnumber for the validated patron
1102
            userid:
1103
              type: string
1104
              description: userid for the validated patron
1105
          additionalProperties: false
1096
      "400":
1106
      "400":
1097
        description: Bad request
1107
        description: Bad request
1098
        schema:
1108
        schema:
1099
- 

Return to bug 34313