HomePhabricator
Diffusion Comm 546bf954bd95

[lib] Add identityInvalidSessionDowngrade

Description

[lib] Add identityInvalidSessionDowngrade

Summary:
Adding a function that checkes if session downgrade is valid or not. Similarily to invalidSessionDowngrade, we check if

  1. Some user is currently logged in
  2. The action is trying to downgrade the session (currentUserInfo is being set to null or {anonymous: true})
  3. The user is the same user the action was dispatched for
  4. The session is the same session the action was dispatched for (checking if CSAT changed)

See this discussion for examples of scenarios in which a session downgrade is invalid

Test Plan:
Tested that if different user infos are provided in actionCurrentUserInfo and preRequestUserState.currentUserInfo then the function returns true.
Tested that if a different CSAT is present in currentReduxState and preRequestUserState, the function returns true.

Reviewers: michal, kamil, ginsu

Reviewed By: michal

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10962

Details

Provenance
inkaAuthored on Feb 5 2024, 7:22 AM
Reviewer
michal
Differential Revision
D10962: [lib] Add identityInvalidSessionDowngrade
Parents
rCOMM14ff8020af61: [CI] Remove `action-tmate`
Branches
Unknown
Tags
Unknown