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

Bug: State not set on page refresh #169

Open
dbarkowsky opened this issue Sep 24, 2024 · 0 comments
Open

Bug: State not set on page refresh #169

dbarkowsky opened this issue Sep 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dbarkowsky
Copy link
Collaborator

Description

When a user is already authenticated and on a page, triggering a refresh of the page and immediately calling the getAuthorizationHeaderValue function will return Bearer undefined.

It seems like the function is available before the state is repopulated, so state.accessToken is undefined.

Priority

high - This issue has a substantial impact.

Package Versions

@bcgov/citz-imb-sso-react: 1.0.1 and newer
@bcgov/citz-imb-sso-express: any, not relevant

To Reproduce

Steps to reproduce the behavior:

  1. Have code that will call getAuthorizationHeaderValue when loading in a component contained within the SSOProvider.
  2. Ensure the result is printed out
  3. Log in
  4. Refresh the page
  5. See that the wrong value is received, despite being logged in

This branch of PIMS will demonstrate the issue:
bcgov/PIMS#2700

Expected Behavior

I would expect this function to wait until it is populated in some way, so not to return a bad value. Maybe it could return a promise instead.

@dbarkowsky dbarkowsky added the bug Something isn't working label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant