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

fix: fetchCurrentUser does not validate token expiration time #1396

Merged

Conversation

Junjiequan
Copy link
Member

@Junjiequan Junjiequan commented Feb 9, 2024

Description

When a user logs in, the loopbackAuth mechanism stores the authentication token in the browser's cookies. However, it fails to automatically remove this token once it has expired. Consequently, when the FetchCurrentUser action attempts to retrieve the user's profile from the backend using this expired JWT token, it results in a 401 Unauthorized error due to the token's invalidity.

Motivation

Background on use case, changes needed

Fixes:

  • Items added

Changes:

  • changes made

Tests included/Docs Updated?

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)
  • Docs updated?
  • New packages used/requires npm install?
  • Toggle added for new features?
  • Requires update of SciCat backend API?

@Junjiequan Junjiequan merged commit 6daae95 into master Feb 19, 2024
6 checks passed
@Junjiequan Junjiequan deleted the SWAP-3792-scicat-fe-refresh-page-without-login-shows-401-un branch February 19, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants