Tracks the app that was already in place (capture, treatment, outreach, WhatsApp integration, server, frontend, tests, docs) so future feature work can branch and use isolated worktrees.
17 lines
455 B
JavaScript
17 lines
455 B
JavaScript
/* Tela de login: autentica e redireciona para o app. */
|
|
el('form-login').addEventListener('submit', async (event) => {
|
|
event.preventDefault();
|
|
const erroBox = el('login-erro');
|
|
erroBox.textContent = '';
|
|
|
|
try {
|
|
await API.post('/api/auth/login', {
|
|
username: el('login-username').value,
|
|
password: el('login-password').value
|
|
});
|
|
window.location.href = '/';
|
|
} catch (error) {
|
|
erroBox.textContent = error.message;
|
|
}
|
|
});
|