fix: refresh user details while refreshing token
Username stored in localstorage was not refreshed along with token as it was being reused. This commit clears it and fetches it again while refreshing the token.
Supporting information
-
Private ref
Jira ticket: BB-6679 - GitLab issue: #53 (closed)
Testing instructions
Step by step produce
- Add below part to
backend/conf/settings/local.py
to expire access_token after 5 seconds.
OAUTH2_PROVIDER = {
"ACCESS_TOKEN_EXPIRE_SECONDS": 5
}
- Start server using
make up
and frontend usingmake run.frontend
- Login and open devtools network tab.
- Manually change username to something else
- Click on any item after 5 seconds, the username should be updated back to the correct one.
Author notes and concerns
Still not sure how the username could be changed without manually updating via devtools.
Edited by Navin Karkera