function invite_github()

in htdocs/js/boxer.js [69:102]


function invite_github(canvas) {
    GET("api/invite").then(
        (js) => {
            if (js.okay) {
                canvas.innerHTML = "";
                init_step(canvas, 2)
                canvas.appendChild(h2("GitHub Organization Membership"))
                canvas.appendChild(txt("An invitation has been sent to your email address. You may also review it here: "));
                let a = document.createElement("a");
                a.setAttribute("href", `https://github.com/orgs/${gh_org}/invitation`);
                a.setAttribute("target", "_new");
                a.innerText = "Review invitation";
                canvas.appendChild(a);
                let p = document.createElement('p');
                p.appendChild(txt("Once you have accepted your invitation, the Boxer service will start including you in the teams you have been assigned to. "));
                p.appendChild(br());
                p.appendChild(txt("It may take up to five minutes before this happens. This page will reload once your invitation has been recorded as accepted, sit tight..."));
                canvas.appendChild(p);
                let loader = document.createElement('div');
                loader.setAttribute('class', 'loader');
                canvas.appendChild(loader);
                check_github_invite(canvas);
            } else {
                if (js.reauth === true) {
                    canvas.innerText = "It looks like something went wrong with the invitation. You have likely previously been a member of the organization and then left. To fix this, we'll need to re-authenticate you on GitHub. Please hang on while we sort that out....";
                    window.setTimeout(() => { location.search = ''; location.reload();}, 3000);
                }
                else {
                    canvas.innerText = "Oops! Something went wrong, you may already have an invitation pending."
                }
            }
        }
    )
}