-
Notifications
You must be signed in to change notification settings - Fork 26
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-846 update session data with values from _self request #1466
Conversation
When restoring an existing session, i.e. pulling session values from storage and merging them with results from the response to the `_self` request, allow the `_self` values to overwrite the others, including updates to the `user` and `permissions` objects. This allows name and permission changes to take effect immediately, simply by reloading, rather than requiring a sign-out/sign-in cycle. There are two main aspects to this change: * A bug fix: previously, the `_self` request omitted the `expandPermissions=true` param that is necessary to retrieve the expanded and flattened permissions, instead returning only those values that are directly assigned. * User and permissions values from the `_self` response now overwrite those from the existing session in storage. Additionally, the `tokenExpiration` value from the existing session is used as-is. Previously, it was overwritten with dummy values with the explanation that "the response from _self doesn't contain these values" ... but that's fine. The fact that the request to `_self` succeeded tells us the tokens are valid and therefore that the values in the existing session are valid. Refs STCOR-846
BigTest Unit Test Statistics 1 files ±0 1 suites ±0 11s ⏱️ ±0s Results for commit b5be7a0. ± Comparison against base commit 2b86b9e. This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Bigtest Unit Test Results193 tests ±0 188 ✅ ±0 6s ⏱️ ±0s Results for commit 6d90bee. ± Comparison against base commit 80bda77. This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Quality Gate passedIssues Measures |
When restoring an existing session, i.e. pulling session values from storage and merging them with results from the response to the
_self
request, allow the_self
values to overwrite the others, including updates to theuser
andpermissions
objects. This allows name and permission changes to take effect immediately, simply by reloading, rather than requiring a sign-out/sign-in cycle.There are two main aspects to this change:
_self
request omitted theexpandPermissions=true
param that is necessary to retrieve the expanded and flattened permissions, instead returning only those values that are directly assigned._self
response now overwrite those from the existing session in storage.Additionally, the
tokenExpiration
value from the existing session is used as-is. Previously, it was overwritten with dummy values with the explanation that "the response from _self doesn't contain these values" ... but that's fine. The fact that the request to_self
succeeded tells us the tokens are valid and therefore that the values in the existing session are valid.Refs STCOR-846