Skip to content

Commit 970f1b7

Browse files
committed
Get the csrfToken from Blacklight.Core
1 parent 82f4925 commit 970f1b7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/javascript/controllers/tokens.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Controller } from '@hotwired/stimulus'
2+
import Blacklight from 'blacklight-frontend/app/assets/javascripts/blacklight/blacklight'
23

34
export default class extends Controller {
45
static targets = [ "output", "result", "button" ]
@@ -7,7 +8,7 @@ export default class extends Controller {
78
fetch(this.data.get("url"), {
89
method: 'POST',
910
headers: {
10-
"X-CSRF-Token": Blacklight.csrfToken(),
11+
"X-CSRF-Token": Blacklight.Core.csrfToken(),
1112
}
1213
}).then(response => response.text())
1314
.then(token => {

0 commit comments

Comments
 (0)