a more modular login logic, html&js