Skip to content

Commit

Permalink
Authentication Basics: Use locals.user check (#28840)
Browse files Browse the repository at this point in the history
Prevent undefined error if user not passed to view
  • Loading branch information
Figby222 authored Sep 23, 2024
1 parent 29f811a commit 5dacf0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nodeJS/authentication/authentication_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ and then edit your view to make use of that object like this:
<title></title>
</head>
<body>
<% if (user) {%>
<% if (locals.user) {%>
<h1>WELCOME BACK <%= user.username %></h1>
<a href="/log-out">LOG OUT</a>
<% } else { %>
Expand Down

0 comments on commit 5dacf0f

Please sign in to comment.