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 === '') if (Elements.passwordInput.value == null || Elements.passwordInput.value === '')
return errReset('Password is required!', Elements.submitButton); return errReset('Password is required!', Elements.submitButton);
alert(`Attempting to login user [${Elements.usernameInput.value}]`);
fetch('/api/login', { fetch('/api/login', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },

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

Loading…
Cancel
Save