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

STCOR-900: (ECS) Automatically logged into Central tenant after logging out from Member tenant #1550

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

aidynoJ
Copy link
Contributor

@aidynoJ aidynoJ commented Oct 22, 2024

Purpose

STCOR-900 - (ECS) Automatically logged into Central tenant after logging out from Member tenant.

Approach

On login, we store tenant data in localStorage and use it as the initial state of the Redux store for okapi.tenant. When the affiliation changes, okapi.tenant updates, but the tenant in localStorage does not. As a result, the updated okapi.tenant is sent on logout. Since the tenant in the x-okapi-token and the x-okapi-tenant header on logout should match, use the tenant data stored in localStorage for the x-okapi-tenant header.

Refs

https://folio-org.atlassian.net/browse/STCOR-900

@aidynoJ aidynoJ requested review from zburke and ryandberger October 22, 2024 14:40
Copy link

github-actions bot commented Oct 22, 2024

Bigtest Unit Test Results

192 tests  ±0   187 ✅ ±0   6s ⏱️ ±0s
  1 suites ±0     5 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 19c7a87. ± Comparison against base commit c60612d.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Oct 22, 2024

Jest Unit Test Results

  1 files  ±0   56 suites  ±0   1m 33s ⏱️ -2s
340 tests +1  340 ✅ +1  0 💤 ±0  0 ❌ ±0 
344 runs  +1  344 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 19c7a87. ± Comparison against base commit c60612d.

♻️ This comment has been updated with latest results.

Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes are fine, and simple, but even so still need test coverage. Please add this before you commit. A comment in loginService.js::logout() explaining why this call is necessary would be helpful too.

We oughtta consider writing generic, publicly-exported local-storage and session-storage functions with namespacing etc. That would allow us to avoid writing all these tiny new specialty functions like getFoo() and getBar(), and allow us not to have to write a bunch of identical tests. It would also decrease the bikeshedding in individual applications. I'll write up an STCOR ticket for this.

Copy link

@aidynoJ aidynoJ merged commit d2cc819 into master Oct 23, 2024
26 checks passed
@aidynoJ aidynoJ deleted the STCOR-900 branch October 23, 2024 11:02
zburke pushed a commit that referenced this pull request Oct 31, 2024
…ng out from Member tenant (#1550)

Refs STCOR-900.

(cherry picked from commit d2cc819)
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.

3 participants