find sso flow in all of the flows

This commit is contained in:
d42 2020-12-31 16:09:42 +01:00
parent afdd35db22
commit 4bc25ffb15

View file

@ -315,10 +315,14 @@ LoginPage::checkHomeserverVersion()
if (err || flows.flows.empty()) if (err || flows.flows.empty())
emit versionOkCb(LoginMethod::Password); emit versionOkCb(LoginMethod::Password);
if (flows.flows[0].type == mtx::user_interactive::auth_types::sso) LoginMethod login_method = LoginMethod::Password;
emit versionOkCb(LoginMethod::SSO); for(const auto &flow : flows.flows) {
else if (flow.type == mtx::user_interactive::auth_types::sso) {
emit versionOkCb(LoginMethod::Password); login_method = LoginMethod::SSO;
break;
}
}
emit versionOk(login_method);
}); });
}); });
} }