async function changeCredentials() {
    const oldPassword = document.getElementById("oldPassword").value;
    const newUsername = document.getElementById("newUsername").value;
    const newPassword = document.getElementById("newPassword").value;

    const res = await fetch("/changeCredentials", {
        method: "POST",
        headers: {"Content-Type":"application/json"},
        body: JSON.stringify({ oldPassword, newUsername, newPassword })
    });

    const data = await res.json();
    alert(data.message);
}