Skip to content

dashboard.mjs

up2108272 edited this page Apr 24, 2024 · 8 revisions

dashboard.mjs

Basic information

  • Main page user sees after logging in

eventListeners()

function eventListeners() {
    signOutbtn = document.querySelector('.signOut');
    signOutbtn.addEventListener('click', signOut);
    displayUserData();
}
  • Links the signOutBtn object to the signOut() function on click

signOut()

function signOut() {
    auth.signOutFn('../index.html');
}
  • Signs out and redirects the user

function displayUserData()

function displayUserData() {
    const emailP = document.querySelector('#emailP');
    emailP.textContent = sessionStorage.getItem('email');
}
  • Updates P tags on dashboard.html with user data from auth.mjs

Clone this wiki locally