Clean up login js code.