Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show an unauthorized message when unauthorized #162

Open
blms opened this issue Apr 5, 2021 · 1 comment
Open

Always show an unauthorized message when unauthorized #162

blms opened this issue Apr 5, 2021 · 1 comment
Labels
bug Something isn't working UI/UX Related to the user interface

Comments

@blms
Copy link
Member

blms commented Apr 5, 2021

There are currently circumstances that you get a 500 error instead, but we want to always show an unauthorized message.

If the user isn't signed in, we definitely need to display an unauthorized screen. We have this code for that:

{!session && !loading && (
  <UnauthorizedCard />
)}

In the case that a fetch fails in getInitialProps, we need to always pass along an error message to the page—and getInitialProps should immediately stop trying to do further fetching. Then, we want to display that error message, and make sure that if the main data we use is undefined, that code using it doesn't try to be run.

@blms blms added bug Something isn't working UI/UX Related to the user interface labels Apr 5, 2021
@blms
Copy link
Member Author

blms commented Apr 5, 2021

A specific example was a Document page that gave the error message Cannot read property 'length' of undefined when not logged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI/UX Related to the user interface
Projects
None yet
Development

No branches or pull requests

1 participant