mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-08 17:06:42 +00:00
show login on logout
This commit is contained in:
@@ -28,8 +28,6 @@
|
|||||||
models = {},
|
models = {},
|
||||||
modelList = [];
|
modelList = [];
|
||||||
|
|
||||||
let authToken;
|
|
||||||
|
|
||||||
let autoScrolling = false,
|
let autoScrolling = false,
|
||||||
searchAvailable = false,
|
searchAvailable = false,
|
||||||
jsonMode = false,
|
jsonMode = false,
|
||||||
@@ -688,6 +686,10 @@
|
|||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const err = await response.json();
|
const err = await response.json();
|
||||||
|
|
||||||
|
if (err?.error === "unauthorized") {
|
||||||
|
showLogin();
|
||||||
|
}
|
||||||
|
|
||||||
throw new Error(err?.error || response.statusText);
|
throw new Error(err?.error || response.statusText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -910,6 +912,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showLogin() {
|
||||||
|
$password.value = "";
|
||||||
|
|
||||||
|
$authentication.classList.add("open");
|
||||||
|
}
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
const data = await json("/-/data");
|
const data = await json("/-/data");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user