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

Display error message when unauthorized #164

Merged
merged 7 commits into from
Jul 23, 2021
Merged

Display error message when unauthorized #164

merged 7 commits into from
Jul 23, 2021

Conversation

alexashley
Copy link
Contributor

@alexashley alexashley commented Jul 23, 2021

Closes #155
Closes #128

  • added a wrapper around the Next.js api routes to handle known methods and exceptions
  • updated the api utils to prepend the Rode API url, since it's the only service in use.
  • all Next.js api endpints will proxy the Rode status code in case of an error
  • any actions on the front end that aren't covered under the anonymous role should display a toast message:

Screen Shot 2021-07-22 at 4 06 33 PM

@RobertKelly
Copy link

Like it!

@@ -102,6 +104,11 @@ const PolicyForm = ({

setLoading(false);

if (response.status === StatusCodes.FORBIDDEN) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an issue to address the redundancy of these checks: #165

Copy link
Contributor

@mrparkers mrparkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested this locally in a few places and everything works the way I expect it to.

LGTM, nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display unauthorized errors in the error toast notification Extract generic Next.js API handler
3 participants