login js refactoring
login js refactoring #2