Updated login logic, and dynamic home page switching