project/src/main/webapp/script.js
/**
 * Checks login status and displays navbar and profile if user is logged in,
 * and redirects to index page if user is not logged in.
 */
Checks login status and displays navbar and profile if user is logged in,
and redirects to index page if user is not logged in.
Checks login status and displays navbar and profile if user is logged in and redirects to index page if user is not logged in .
async function actOnLoginStatus() {
  const loggedIn = await isLoggedIn();
  if (loggedIn) {
    loadHeader();
  } else {
    window.location.href = 'index.html';
  }
}
async function actOnLoginStatus ( ) { const loggedIn = await isLoggedIn ( ) ; if ( loggedIn ) { loadHeader ( ) ; } else { window . location . href = 'index.html' ; } }
Checks login status and displays navbar and profile if user is logged in,
 and redirects to index page if user is not logged in.
Checks login status and displays navbar and profile if user is logged in and redirects to index page if user is not logged in .