Refactor OAuthLogin.