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

Handle specific authentication errors #428

Open
LanesGood opened this issue Mar 16, 2023 · 3 comments
Open

Handle specific authentication errors #428

LanesGood opened this issue Mar 16, 2023 · 3 comments
Assignees
Labels
Type: Bug Something isn't working
Milestone

Comments

@LanesGood
Copy link
Member

Ensure that the API throws a 401 error when user is not authenticated, and then ensure the frontend displays appropriate error messages.

@LanesGood
Copy link
Member Author

The team page does have an error handler, but no 401 is thrown by the API when a user is not authenticated:
https://github.com/developmentseed/osm-teams/blob/develop/src/pages/teams/%5Bid%5D/index.js#L206

Investigate src/middlewares/base-handler.js

@LanesGood LanesGood added the Type: Bug Something isn't working label Mar 17, 2023
@LanesGood
Copy link
Member Author

Invitations do throw an error status if the user is not logged in, and this is rendered on the frontend:
image

All protected routes should check for user authentication, permission, and throw proper errors to render this message when an unauthenticated user visits a protected route.

@LanesGood
Copy link
Member Author

Example: the nextauth page is displayed when I visit an org page and am not logged in, instead of a "this page is protected" page:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants