simpleadmin-web/internal/web/assets/signin.js

13 lines
609 B
JavaScript

// Explains why someone landed on the sign-in page: a failed Steam sign-in, or an account without a
// staff rank.
const err = new URLSearchParams(location.search).get("signin");
if (err) {
const box = $("#signin-error");
box.textContent = `Steam sign-in didn't work: ${err.replace(/^steam: /, "")}`;
box.hidden = false;
}
api("/api/me").then((me) => {
if (me.signedIn && !me.staff) {
$("#signin-msg").textContent = `You're signed in as ${me.steamid}, but that account has no staff rank on this server. Sign in with a different Steam account, or ask an admin to add you.`;
}
}).catch(() => {});