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

Logout the user on 401 status code #27

Open
3 tasks
jatinkatyal13 opened this issue Jul 24, 2020 · 1 comment
Open
3 tasks

Logout the user on 401 status code #27

jatinkatyal13 opened this issue Jul 24, 2020 · 1 comment

Comments

@jatinkatyal13
Copy link
Contributor

Currently, the react fetches the user details from the jwt stored in the user's local storage of the browser. But even if the jwt is expired it reads and considers the user to be logged in and the API requests fail with 401.

ToDos

Frontend

  • On boot setTimeout on 60 minutes before jwt expiration to send a refresh token request, if the time is negative send request immediately
  • Write an axios request interceptor to logout the user when receiving 401 status code

Backend

  • Implement a hook in services/oneauth to refresh the jwt
    • jwt shouldn't have been expired for more than 7 days
@Shubhamdutta2000
Copy link

I would like to fix this issue

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

No branches or pull requests

2 participants