Complete front end main-login logic