summary refs log tree commit diff
diff options
context:
space:
mode:
authord42 <d42@users.noreply.github.com>2020-12-31 16:09:42 +0100
committerd42 <d42@users.noreply.github.com>2020-12-31 17:30:13 +0100
commit4bc25ffb15d1e559417550a64ca8995ce894f8a8 (patch)
tree62764d4203d957a69999b1371ef54e7ab76a9658
parentMerge pull request #363 from trilene/master (diff)
downloadnheko-4bc25ffb15d1e559417550a64ca8995ce894f8a8.tar.xz
find sso flow in all of the flows
Diffstat (limited to '')
-rw-r--r--src/LoginPage.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/LoginPage.cpp b/src/LoginPage.cpp
index 05741cca..fc918359 100644
--- a/src/LoginPage.cpp
+++ b/src/LoginPage.cpp
@@ -315,10 +315,14 @@ LoginPage::checkHomeserverVersion()
                             if (err || flows.flows.empty())
                                     emit versionOkCb(LoginMethod::Password);
 
-                            if (flows.flows[0].type == mtx::user_interactive::auth_types::sso)
-                                    emit versionOkCb(LoginMethod::SSO);
-                            else
-                                    emit versionOkCb(LoginMethod::Password);
+                            LoginMethod login_method = LoginMethod::Password;
+                            for(const auto &flow : flows.flows) {
+                                if (flow.type == mtx::user_interactive::auth_types::sso) {
+                                    login_method = LoginMethod::SSO;
+                                    break;
+                                }
+                            }
+                            emit versionOk(login_method);
                     });
           });
 }