Add an AccountProvider type and use it within the authentication flow. (#6103)

* Add an AccountProvider type and use it within AppSettings.

* Use the AccountProvider type within the Authentication flow too.

* Fix unit test compilation with Swift 6.4

* Make sure defaultAccountProvider takes allowOtherAccountProviders into account.

* Document a caveat on using AuthenticationService.homeserver.value.accountProvider.
This commit is contained in:
Doug
2026-09-14 15:25:33 +01:00
committed by GitHub
parent 26fddb8aa2
commit 64aae09c6d
29 changed files with 442 additions and 265 deletions
@@ -150,7 +150,12 @@ class MockScreen: Identifiable {
let appSettings: AppSettings! = appSettings
if id == .singleProviderAuthenticationFlow || id == .multipleProvidersAuthenticationFlow {
let accountProviders = id == .singleProviderAuthenticationFlow ? ["example.com"] : ["guest.example.com", "example.com"]
let accountProviders: [AccountProvider] = if id == .singleProviderAuthenticationFlow {
[.managed(serverName: "example.com", baseURL: "https://matrix.example.com")]
} else {
[.managed(serverName: "guest.example.com", baseURL: "https://matrix.guest.example.com"),
.managed(serverName: "example.com", baseURL: "https://matrix.example.com")]
}
appSettings.override(accountProviders: accountProviders,
allowOtherAccountProviders: false,
hideBrandChrome: false,