moved login logic into the login component