Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
JMarcosMoura committed Jan 17, 2025
1 parent 87e25a2 commit ddc5030
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ fetch('js/backend.json')

document.addEventListener('DOMContentLoaded', () => {
const user = JSON.parse(localStorage.getItem('loggedUser'));
console.log('Dados do usuário recuperados do localStorage:', user);

if (user) {
document.querySelector('#user_infos .item-description:nth-child(1)').textContent = user.name;
document.querySelector('#user_infos .item-description:nth-child(2)').textContent = user.email;
} else {
console.warn('Nenhum usuário encontrado no localStorage. Redirecionando para login.');
window.location.href = '../login.html';
}
});
});

0 comments on commit ddc5030

Please sign in to comment.