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

(-)a/Koha/REST/V1/Auth/Password.pm (+10 lines)
Lines 45-50 sub validate { Link Here
45
    my $identifier = $body->{identifier};
45
    my $identifier = $body->{identifier};
46
    my $userid     = $body->{userid};
46
    my $userid     = $body->{userid};
47
47
48
    my $embeds = $c->stash('koha.embed');
49
    my $embed_patron;
50
    $embed_patron = 1
51
        if $embeds && exists $embeds->{patron};
52
53
    # fake embed as the basis is not a Koha::Object-derived class
54
    # remove it so $c->objects->to_api doesn't try to embed 'patron'.
55
    delete $embeds->{patron};
56
48
    unless ( defined $identifier or defined $userid ) {
57
    unless ( defined $identifier or defined $userid ) {
49
        return $c->render(
58
        return $c->render(
50
            status  => 400,
59
            status  => 400,
Lines 86-91 sub validate { Link Here
86
                cardnumber => $patron->cardnumber,
95
                cardnumber => $patron->cardnumber,
87
                patron_id  => $patron->id,
96
                patron_id  => $patron->id,
88
                userid     => $patron->userid,
97
                userid     => $patron->userid,
98
                ( $embed_patron ? ( patron => $c->objects->to_api($patron) ) : () ),
89
            }
99
            }
90
        );
100
        );
91
    } catch {
101
    } catch {
(-)a/api/v1/swagger/paths/auth.yaml (-1 / +15 lines)
Lines 1112-1117 Link Here
1112
      - patrons
1112
      - patrons
1113
    summary: Check validity of username and password
1113
    summary: Check validity of username and password
1114
    parameters:
1114
    parameters:
1115
      - name: x-koha-embed
1116
        in: header
1117
        required: false
1118
        description: Embed list sent as a request header
1119
        type: array
1120
        items:
1121
          type: string
1122
          enum:
1123
            - patron
1124
        collectionFormat: csv
1115
      - name: body
1125
      - name: body
1116
        in: body
1126
        in: body
1117
        description: |
1127
        description: |
Lines 1157-1162 Link Here
1157
            userid:
1167
            userid:
1158
              type: string
1168
              type: string
1159
              description: userid for the validated patron
1169
              description: userid for the validated patron
1170
            patron:
1171
              type:
1172
                - object
1173
                - "null"
1174
              description: The related patron object (x-koha-embed)
1160
          additionalProperties: false
1175
          additionalProperties: false
1161
      "400":
1176
      "400":
1162
        description: Bad request
1177
        description: Bad request
1163
- 

Return to bug 40023