Skip to content
Snippets Groups Projects

User authentication implemented

Merged Jesus Galaz Reyes requested to merge 5-implement-user-authentication into main
Files
7
+ 17
0
// Obtener referencia a los elementos del DOM
const taskList = document.querySelector('.task-list ul');
const newTaskForm = document.querySelector('form');
// Logout
document.getElementById('logout-btn').addEventListener('click', async () => {
try {
const res = await fetch('/api/users/logout', { method: 'POST' });
if (res.ok) {
window.location.href = 'login.html';
} else {
console.error('Logout failed');
}
} catch (err) {
console.error('Error during logout:', err);
}
});
\ No newline at end of file
Loading