[keyserver] Fix sending a user cookie when olm session creation failed
Summary:
issue: ENG-7247
It used to be possible to have a user cookie even though the notif olm session creation failed. This was because the cookie was created before the session, so even though an error was thrown, the user cookie would be sent with it.
We want to create the user cookie once both olm sessions are created. The only thing I really did here is moving code around so that the cookie creation is called after both session are created
Test Plan:
keyserverAuthResponder:
Tested that if an error if thrown from olmNotifSession, the user doesn't get a user cookie and is no longer logged in after refreshing the app
Tested this for both users how were already registered with the keyserver, and users who weren't
Tested that it is possible to login if olm sessions are created correctly
logInResponder:
Tested that it is possible to login if everything works. Tested that if an error if thrown from olmNotifSession, the user doesn't get a user cookie and is not logged in after refreshing the app
siweAuthResponder:
Tested registering. I am facing a problem, but I am also facing it on master. Please see ENG-8055. But same as on master, the user gets registered with the keyserver, just the UI hangs.
Tested logging in with SIWE auth - this worked without problems
Reviewers: varun, tomek, ashoat
Reviewed By: ashoat
Subscribers: kamil, ashoat
Differential Revision: https://phab.comm.dev/D11780