const token = docCookies.getItem("token"); const amountElement = document.getElementById("amount"); const listElement = document.getElementById("list"); const userElement = document.getElementById("user"); window.addEventListener("load", async function () { userElement.innerText = docCookies.getItem("token").substring(0, 4) + "**"; listElement.href = `https://${api_provider}/get_cheques?token=${token}`; amountElement.innerText = await getBalance(token); }); function logout() { docCookies.removeItem("token"); window.location = "/auth/"; }