Add the login logic