Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
login.js 467 B
Newer Older
  • Learn to ignore specific revisions
  • Pierre Jarriges's avatar
    Pierre Jarriges committed
    const login_form = document.getElementById("login-form");
    login_form.onsubmit = e => {
        e.preventDefault();
        fetch("/admin-auth", {
            method: "POST",
            body: new URLSearchParams(new FormData(e.target))
        }).then(res => {
            if (res.status >= 400) {
                alert(res.statusText)
            } else {
                window.location.assign("/v/admin-panel")
            }
        }).catch(err => {
            alert(err.statusText || "Server error")
        });
    }