For my web project, I am utilizing HTML, Java, and CSS. The website is hosted on an Express server generated with express-generator using EJS template. I want to implement a feature where once a user logs in (using Passport and Bcrypt), they are redirected to the "home" page but instead of seeing the "log in" and "subscribe" options, they should see a "logout" option and an icon to access their user profile. Can this be achieved in EJS?
I attempted using <% if (isLoggedIn)
... but it did not work, so I removed the code. Could you provide me with a practical example including a few lines of code, please?
<header> /*home page*/
<div class="container">
<img src="/images/logo.png" alt="logo" class="logo">
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/articles">Articles</a></li>
<li><a href="/series">Series</a></li>
<li><a href="/logout">Logout</a></li>
<li><a href="/profile">Profile</a></li>
</ul>
</nav>
</div>
</header>