redwoodjs / redwood-tutorial

The end state after completing the RedwoodJS introduction tutorial
https://redwoodjs.com/tutorial
40 stars 109 forks source link

Update BlogLayout.js #107

Open mantzuri opened 1 year ago

mantzuri commented 1 year ago

Add optional to currentUser.email This will prevent the application from throwing an error when there is no entries in the DB

cannikin commented 1 year ago

Did you actually get see an error at this point in the code? This is behind the isAuthenticated check, so it should only be displayed if a user was logged in, and you can only log in if there's a user in the database...or maybe I missed something and this is displayed somehow?

cannikin commented 11 months ago

There are some places in the tutorial where an error is thrown "on purpose" to show users why it happens and how to fix it. Does the text of the tutorial depend on currentUser not being optional in order to demonstrate something? Fixing this could make that surrounding text confusing if an expected error doesn't occur!