dabit3 / gatsby-auth-starter-aws-amplify

Starter Project with Authentication with Gatsby & AWS Amplify
MIT License
324 stars 399 forks source link

Fix "null" user issue #9

Closed gcko closed 5 years ago

gcko commented 5 years ago

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

gcko commented 5 years ago

@dabit3 ping on this issue

dabit3 commented 5 years ago

Hey @gcko , thanks so much for this fix! It's been merged.