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>
(cherry picked from commit a369ace161)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
David Cook 2024-10-22 00:31:23 +00:00 committed by Lucas Gass
parent 9acd02725c
commit 6bde7f52b9
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 );
} );