-
Notifications
You must be signed in to change notification settings - Fork 59
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
Namerequest UI: "isAuthenticated" is not refreshed on login #18115
Comments
@ozamani9gh Something for your consideration. |
|
Proposed solution # 1 (simplest)Use a store variable to maintain the "is authenticated" state. Update it when the app starts (in Sample code change: bcgov/namerequest#726. Proposed solution # 2Wait for current account to be available, as is done here: https://github.com/bcgov/business-edit-ui/blob/05d30b4c5a59ad29050bf27b52573f6a3c74cbac/src/App.vue#L557 Proposed solution # 3 (best)Link to the auth store and read its state directly, as is done here: https://github.com/bcgov/business-filings-ui/blob/23ee32c04343d48ca84161843e8bb10a5eab9f90/src/stores/authenticationStore.ts#L25 |
@Mihai-QuickSilverDev @severinbeauvais are you hoping Names Team picks up this work. If so: Does this need to be groomed, worked on as part of WoN Release, or can we start this after the implementation. our team is at velocity this sprint, so I would need to move priorities around |
This bug has been around for years and I think very few users will bump into it, so it's not P1 and can be fixed later (IMHO). |
@ozamani9gh Hi Omid, yes, this is a Names ticket, and would leave it to you to schedule. It can be done after the WoN go-live on October 17. |
Ready to test in DEV and TEST environments. |
I tested it and the correct breadcrumb displayed when I logged in.. |
This issue was found in #18023, in which the logged-in breadcrumb was not being displayed until the app is reloaded.
Private Zenhub Image
Private Zenhub Image
Analysis
isAuthenticated
is a store getter that checks the existence of a Keycloak token in session storage. However, the KC token is not populated until a few seconds after the user logs in (it's async in the SbcHeader component), and isAuthenticated is not responsive to it because it's in session storage. Bottom line: isAuthenticated does not get updated after a successful login.The impact is that any code that checks if the user is logged in will not work correctly. This bug has existed since NR UI was first implemented, but now it's visible in the breadcrumb (which itself is low severity).
This only happens if the user goes to NR UI while logged out and then logs in. If the user is already logged in and goes to NR UI then this bug doesn't manifest.
The text was updated successfully, but these errors were encountered: