[lib] validate policies after user login
Summary:
Follow up to: https://phab.comm.dev/D5875#inline-39619.
Diff introduces a hook to check if there is information about not acknowledged policies in login response and dispatch an action if needed.
Additionally, it removes data from the response to not share data with user until acceptance.
Probably I'll wait with landing this until most of the SIWE feature will be ready to test end-to-end how this change works with login using wallet.
Test Plan:
- Logout user
- Set terms policy as not accepted for user in DB
- Login with credentials and separately using SIWE
- Login action should finish with success and the modal should show immediately after it. Data about user messages, threads, calendar, etc. should not be present in the login response.
- Test for both web/native
Reviewers: inka, przemek, michal, ashoat, atul
Reviewed By: ashoat
Subscribers: ashoat, tomek, atul
Differential Revision: https://phab.comm.dev/D6092