Implement login logic.