Implement login and login failed