Following what you said, I am using this check to try to hide the registration and login when the user is logged in and in place put a drop menu, but I am having a problem.
Registration and login are always appearing, logged in or not logged in what I am doing wrong?
<% if (this.user) { %>
<div class="btn-group">
<button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span></button>
<ul class="dropdown-menu" role="menu">
<li><a href="/profile">Minha conta</a></li>
<li><a href="/logout">Logout</a></li>
<li><a href="/painelControle">Meus eventos</a></li>
</ul>
</div>
<% } else{ %>
<li><a href="/cadastroUsuario" class="linkscabecalho">Cadastro</a></li>
<li><a href="/login" class="linkscabecalho"> Login </a></li>
<% } %>
<li><a href="/criarEvento" class="linkscabecalho">Criar evento </a></li>
Try to use local variables for a check since it is using Passport and rendering with ejs
– Lauro Moraes