Fix authentication activity indicators when the authentication server is being slow

* Fetch the OIDC login URL as part of the Server Confirmation screen.

The loading indicator would show and hide while configuring and then immediately show again while fetching the URL.

* Allow the OIDCAuthenticationPresenter to show its own errors.

We no longer need to present errors in the authentication flow coordinator.
This commit is contained in:
Doug
2025-04-10 16:47:11 +01:00
committed by Doug
parent 1557054753
commit 511c4d7bf7
22 changed files with 223 additions and 113 deletions
@@ -29,11 +29,11 @@ enum MockSoftLogoutScreenState: String, CaseIterable {
switch self {
case .emptyPassword:
return SoftLogoutScreenViewModel(credentials: credentials,
homeserver: .mockMatrixDotOrg,
homeserver: .mockBasicServer,
keyBackupNeeded: false)
case .enteredPassword:
return SoftLogoutScreenViewModel(credentials: credentials,
homeserver: .mockMatrixDotOrg,
homeserver: .mockBasicServer,
keyBackupNeeded: false,
password: "12345678")
case .oidc:
@@ -46,7 +46,7 @@ enum MockSoftLogoutScreenState: String, CaseIterable {
keyBackupNeeded: false)
case .keyBackupNeeded:
return SoftLogoutScreenViewModel(credentials: credentials,
homeserver: .mockMatrixDotOrg,
homeserver: .mockBasicServer,
keyBackupNeeded: true)
}
}
@@ -143,7 +143,8 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol {
let presenter = OIDCAuthenticationPresenter(authenticationService: parameters.authenticationService,
oidcRedirectURL: ServiceLocator.shared.settings.oidcRedirectURL,
presentationAnchor: presentationAnchor)
presentationAnchor: presentationAnchor,
userIndicatorController: parameters.userIndicatorController)
self.oidcPresenter = presenter
switch await presenter.authenticate(using: oidcData) {
case .success(let userSession):