From b46ced78def34f81742072c493992afff62c6fb7 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 10 Nov 2016 09:25:00 -0500
Subject: If email accounts are disabled, allow email users to switch account
 type to one of the available types (#4517)

---
 webapp/components/user_settings/user_settings_security.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'webapp/components/user_settings/user_settings_security.jsx')

diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx
index 617acb7f5..0cee3dfca 100644
--- a/webapp/components/user_settings/user_settings_security.jsx
+++ b/webapp/components/user_settings/user_settings_security.jsx
@@ -928,8 +928,9 @@ export default class SecurityTab extends React.Component {
         numMethods = config.EnableLdap === 'true' ? numMethods + 1 : numMethods;
         numMethods = config.EnableSaml === 'true' ? numMethods + 1 : numMethods;
 
+        // If there are other sign-in methods and either email is enabled or the user's account is email, then allow switching
         let signInSection;
-        if (config.EnableSignUpWithEmail === 'true' && numMethods > 0) {
+        if ((config.EnableSignUpWithEmail === 'true' || user.auth_service === '') && numMethods > 0) {
             signInSection = this.createSignInSection();
         }
 
-- 
cgit v1.2.3-1-g7c22

