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

[UI] Redirect user to login page if API returns 401 UNAUTHORIZED error #129

Open
Samy-33 opened this issue Jul 9, 2022 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers UI to label tasks requiring change in UI

Comments

@Samy-33
Copy link
Member

Samy-33 commented Jul 9, 2022

We make calls to our API to perform operations and fetch data. Some of the calls are protected by authentication.

API will respond with HTTP 401 UNAUTHORIZED error for following scenarios for protected API endpoints:

  • No token in request headers.
  • The token is expired.
  • It's an invalid token.

Goal for this issue is to add a middleware for each request we make to our API, perform a check on the response.
If the response code is 401, redirect user to the Login page instantly.

@Samy-33 Samy-33 added enhancement New feature or request good first issue Good for newcomers UI to label tasks requiring change in UI labels Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers UI to label tasks requiring change in UI
Projects
Status: No status
Development

No branches or pull requests

1 participant