Bug 38065: (QA follow-up) Move csrf_token to POST body from URL

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
David Cook 2024-10-22 00:31:23 +00:00 committed by Katrin Fischer
parent bc1af60e1a
commit a369ace161
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 2 deletions

View File

@ -152,9 +152,10 @@ require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge
$( this.node )
.find('.control-number-widget-assign').click( function() {
var sequence = $( widget.node ).find('.control-number-widget-sequence').val();
const token = $("input[name='csrf_token']").first().val();
const csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
$.post(
'/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence + '?csrf_token=' + token
'/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence,
{ csrf_token: csrf_token }
).done( function( result ) {
if ( result.next_value ) widget.setControlNumber( result.next_value );
} );