Page MenuHomePhabricator

[lib] Add identityInvalidSessionDowngrade
ClosedPublic

Authored by inka on Feb 6 2024, 2:41 AM.
Tags
None
Referenced Files
F2901332: D10962.diff
Sat, Oct 5, 12:34 PM
Unknown Object (File)
Fri, Oct 4, 12:34 AM
Unknown Object (File)
Fri, Oct 4, 12:34 AM
Unknown Object (File)
Fri, Oct 4, 12:34 AM
Unknown Object (File)
Fri, Oct 4, 12:34 AM
Unknown Object (File)
Mon, Sep 9, 10:37 AM
Unknown Object (File)
Aug 29 2024, 11:46 PM
Unknown Object (File)
Aug 29 2024, 10:21 AM
Subscribers

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage