-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STCOR-846 update session data with values from _self request (#1466)
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
- Loading branch information
Showing
3 changed files
with
76 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters