Open mantzuri opened 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?
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!
Add optional to
currentUser.email
This will prevent the application from throwing an error when there is no entries in the DB