Working sign in
This commit is contained in:
parent
2901da51f5
commit
77cbb84885
@ -4,7 +4,6 @@ import("https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js");
|
|||||||
|
|
||||||
const body = document.body;
|
const body = document.body;
|
||||||
body.addEventListener('htmx:beforeOnLoad', function (evt) {
|
body.addEventListener('htmx:beforeOnLoad', function (evt) {
|
||||||
console.log(evt);
|
|
||||||
const detail = evt.detail;
|
const detail = evt.detail;
|
||||||
const xhr = detail.xhr;
|
const xhr = detail.xhr;
|
||||||
const status = xhr.status;
|
const status = xhr.status;
|
||||||
@ -26,7 +25,7 @@ body.addEventListener('htmx:beforeOnLoad', function (evt) {
|
|||||||
});
|
});
|
||||||
body.addEventListener('htmx:configRequest', function (evt) {
|
body.addEventListener('htmx:configRequest', function (evt) {
|
||||||
if (localStorage.getItem('jwt')) {
|
if (localStorage.getItem('jwt')) {
|
||||||
evt.detail.headers.Authorization = 'Bearer ' + (localStorage.getItem('jwt') || '');
|
evt.detail.headers.Authorization = 'Bearer ' + (localStorage.getItem('jwt') || '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user