summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-01-01 04:13:49 +0100
committerGitHub <noreply@github.com>2021-01-01 04:13:49 +0100
commitaab7447d028546efdab4158b86198d964b9c6703 (patch)
tree629c3de0c28a62b7310a04764fcfa6b2824c72a0 /src
parentMerge pull request #363 from trilene/master (diff)
parentrename login_method -> loginMethod to fit the Nheko coding style (diff)
downloadnheko-aab7447d028546efdab4158b86198d964b9c6703.tar.xz
Merge pull request #364 from d42/d42/find-sso-flow
Try to find SSO flow in all of the server flows
Diffstat (limited to 'src')
-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..62498738 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 loginMethod = LoginMethod::Password; + for(const auto &flow : flows.flows) { + if (flow.type == mtx::user_interactive::auth_types::sso) { + loginMethod = LoginMethod::SSO; + break; + } + } + emit versionOk(loginMethod); }); }); }