Skip to content

Commit 31ff8ea

Browse files
authored
Updates to token_handler.blade.php to support Livewire 2.x (#1247)
1 parent 7d27600 commit 31ff8ea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/resources/views/partials/token_handler.blade.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
window.jQuery.ajaxSettings.headers = { 'Authorization': bearer };
3232
}
3333
}
34+
35+
if (window.Livewire) {
36+
// livewire
37+
window.livewire.addHeaders({
38+
'Authorization': bearer,
39+
'content-type': 'application/json',
40+
'X-Requested-With': 'XMLHttpRequest'
41+
});
42+
}
3443
3544
if (window.axios) {
3645
// Axios

0 commit comments

Comments
 (0)