Presenting User Account Links

We’ve come a long way. We can now authenticate a user in a secure way. We’re using a single function that we can reliably share across each feature of the application that needs it. Now, we can turn our attention to showing customized headers in our layout based on a user’s authentication status. Let’s start with a welcome message and a logout link.

We want to change the layout of the application to handle the new user features so that other views can also take advantage of these features. Let’s update the layout in lib/rumbl_web/templates/layout/app.html.eex. Replace your <nav> section to look like this:

 <section class=​"container" ...

Get Programming Phoenix 1.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.