coding-blocks / coding-blocks/certificate-worker

Logout the user on 401 status code

Open
#27 1 comment 0 reactions 0 assignees View on GitHub
BOSS BOUNTY: 200
Dominant language
Handlebars
Stars
3
Forks
24
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.