Changed how logins are handled based on request type