if (window.location.href.indexOf("?error=1") > -1) {
    document.getElementById("messages").style.display = "flex";
    setTimeout(() => {
        document.getElementById("messages").style.display = "none";
    }, 5000);
}