Update static/js/04-main.js
This commit is contained in:
parent
810b6b1d65
commit
9061582785
@ -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(() => {});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user