Skip to content

Logout the user on 401 status code #27

Description

@jatinkatyal13

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions