[keyserver] Split up processSuccessfulLogin
Summary:
This diff splits up processSuccessfulLogin into two in order to resolve ENG-8101:
- processSuccessfulLogin (same name as before), which does cookie/session stuff, Olm initialization, policy stuff, and other general "session setup" work
- fetchRegistrationResult, which fetches the data that we need to send to the user in the response.
There's also a new utility handleSuccessfulLoginResult, which looks at the response from processSuccessfulLogin and decides whether to call fetchRegistrationResult.
The reason for splitting it into two is that in the registration case for both siweAuthResponder and keyserverAuthResponder, we want to do some additional steps between these two (sendMessagesOnAccountCreation, formerly known as processAccountCreationCommon).
Depends on D12038
Test Plan:
I tested the following scenarios and made sure that ENG-8101 was resolved (no "anonymous" username):
- I tested account creation via keyserver auth in a multi-keyserver environment
- I tested login via keyserver auth in a multi-keyserver environment
- I tested legacy account creation in a legacy environment
- I tested legacy SIWE account creation in a legacy environment
- I tested legacy SIWE login in a legacy environment
Reviewers: inka
Reviewed By: inka
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D12039