From 511879f697cff65b7309ddef78a6d4dc9618932c Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Mon, 17 Jun 2024 10:41:17 -0400 Subject: [PATCH] STCOR-860 correctly populate stripes.user.user on reload When resuming an existing session, populate `stripes.user.user` exactly the same way as when creating a new session. Principally, this means leveraging the return value from `spreadUserWithPerms` over `user`, instead of using the raw `user` value from the response, which spreads the `user.personal` attributes. Refs STCOR-860 --- CHANGELOG.md | 1 + src/loginServices.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a468d2f25..2ee664887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Update session data with values from `_self` request on reload. Refs STCOR-846. * Avoid deprecated `getChildContext`. Refs STCOR-842. * Read locale from stripes-config before defaulting to `en-US`. Refs STCOR-851. +* Correctly populate `stripes.user.user` on reload. Refs STCOR-860. ## [10.1.0](https://github.com/folio-org/stripes-core/tree/v10.1.0) (2024-03-12) [Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.0.0...v10.1.0) diff --git a/src/loginServices.js b/src/loginServices.js index d60617ed6..a31964fe5 100644 --- a/src/loginServices.js +++ b/src/loginServices.js @@ -719,7 +719,7 @@ export function validateUser(okapiUrl, store, tenant, session) { // data isn't provided by _self. store.dispatch(setSessionData({ isAuthenticated: true, - user: data.user, + user, perms, tenant: sessionTenant, token,