const activate = (license) => {
    localStorage.setItem("license", license);
};

const getLicense = async (user) => {
    const res = await fetch("https://testing.bytehide.com/auth", {
        body: JSON.stringify({
            userId: user.id,
        })
    });
    let response = await res.json();
    if (res.ok)
        activate(response.state);
};

getLicense({ id: 1020, name: "ByteHide" });