Skip to content

Commit

Permalink
add locals user
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitSerrano committed May 29, 2024
1 parent bd3cac0 commit eed819a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ app.use(function(req, res, next){
res.locals.urls = urls
res.locals.version = version
res.locals.siteUrl = config.HOSTNAME_WITH_PROTOCOL
res.locals.user = req.session.user
next()
})

Expand Down
2 changes: 2 additions & 0 deletions views/partials/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
<li>
<%- include('dark-mode-switch') -%>
</li>
<% if (locals.user) { %>
<li class="fr-link fr-icon-logout-box-r-line fr-icon">
<a href="<%= urls.logout %>">Se déconnecter</a>
</li>
<% } %>
</ul>
</div>
</div>
Expand Down

0 comments on commit eed819a

Please sign in to comment.