diff --git a/static/js/04-main.js b/static/js/04-main.js index 7d06626..dcdc488 100644 --- a/static/js/04-main.js +++ b/static/js/04-main.js @@ -260,11 +260,12 @@ Glow.checkAuth = async () => { Glow.authenticate = async endpoint => { Glow.clearAuthNotice(); + const accessKey = Glow.els.accessKeyInput.value; const username = Glow.els.usernameInput.value.trim().toLowerCase(); const password = Glow.els.passwordInput.value; - if (!username || !password) { - Glow.showAuthNotice("Enter a username and password."); + if (!accessKey || !username || !password) { + Glow.showAuthNotice("Enter the private access key, username, and password."); return; } @@ -275,7 +276,7 @@ Glow.authenticate = async endpoint => { const data = await Glow.apiRequest(endpoint, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ username, password }) + body: JSON.stringify({ access_key: accessKey, username, password }) }); Glow.state.currentUser = data.user; @@ -345,7 +346,7 @@ Glow.logout = async () => { Glow.updateAuthUI(); Glow.els.authOverlay.classList.remove("hidden"); - Glow.els.usernameInput.focus(); + Glow.els.accessKeyInput.focus(); await Glow.refreshCsrfToken().catch(() => {}); await Glow.loadFeed().catch(() => {});