When not authenticated, LocalStorage can receive a user value of "null". When this value is parsed from JSON it ends up breaking the return line of the isLoggedIn method.
Adding an additional check to getUser to ensure that if the parsed value is falsy it will return an empty object
When not authenticated, LocalStorage can receive a user value of "null". When this value is parsed from JSON it ends up breaking the return line of the
isLoggedIn
method.Adding an additional check to
getUser
to ensure that if the parsed value is falsy it will return an empty object