From c9f20457830a8cfb2245d21a9410c26b7b3c1548 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= <matma.rex@gmail.com>
Date: Mon, 25 Apr 2016 20:16:08 +0200
Subject: [PATCH 2/2] approach 2

Change-Id: I375bc5be51155d715db8194c9cbaf9a378728fcb
---
 includes/auth/AuthManager.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index 3f52b6f..d740689 100644
--- a/includes/auth/AuthManager.php
+++ b/includes/auth/AuthManager.php
@@ -1909,6 +1909,12 @@ class AuthManager implements LoggerAwareInterface {
 				$providers = $this->getPreAuthenticationProviders() +
 					$this->getPrimaryAuthenticationProviders() +
 					$this->getSecondaryAuthenticationProviders();
+				$user = $user ?: \RequestContext::getMain()->getUser();
+				if ( $user->isAnon() ) {
+					$providers = array_filter( $providers, function ( $p ) {
+						return !( $p instanceof TemporaryPasswordPrimaryAuthenticationProvider );
+					} );
+				}
 				break;
 
 			case self::ACTION_LOGIN_CONTINUE:
-- 
2.8.1.windows.1

