fix: reduce alerts to improve user flow

pull/241/head
Josh Moore 1 year ago
parent 1c12615e01
commit 2746a3e32a

@ -23,8 +23,6 @@ document.addEventListener('DOMContentLoaded', () => {
if (Elements.passwordInput.value == null || Elements.passwordInput.value === '')
return errReset('Password is required!', Elements.submitButton);
alert(`Attempting to login user [${Elements.usernameInput.value}]`);
fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },

@ -105,8 +105,8 @@ document.addEventListener('DOMContentLoaded', () => {
success: boolean,
message: string
}) => {
alert(data.message);
if (data.success) window.location.href = '/login';
if (data.success) window.location.href = '/admin';
else alert(data.message);
});
})
.catch((err) => errAlert('POST to /api/setup failed!', err))

Loading…
Cancel
Save