Implement client-side RocketChat::Login in JavaScript
This would eliminate the need to ever process or store the password of the Rocket.Chat account and eliminate the possibility of the password being logged in plain text if the log level of debug has been set for the webservice manually.