No longer create a new thread for every login or logout request in the same session
Description
Right now, we start a new thread for every login or logout attempt. Since we don't need to support concurrent login and logout requests in the client, we could just have one thread that handles authentication. This is also a good opportunity to refactor, e.g. we currently store the thread ids in a dict so that we can get the current_object in success and failure handlers yet current_object will always be None.
Zooming out: Are there other API calls like login and logout that we fire off individually like this, rather than enqueuing on one of the job queues? Ideally we would generalize a mechanism for doing so, rather than special-casing the login and logout requests.
Closing all refactoring/re-architecting issues pertaining to the old codebase since we're focused on the Electron rewrite.