Merge the AuthenticationService with the QRCodeLoginService. (#4323)

* Merge the AuthenticationServer with the QRCodeLoginService.

* Merge AuthenticationClientBuilderFactory and AuthenticationClientBuilder into AuthenticationClientFactory

The separation is no longer needed now that password/OIDC login and QR code login have a similar API shape.
This commit is contained in:
Doug
2025-07-15 17:59:15 +01:00
committed by GitHub
parent 17000687b5
commit 448bc2d4e3
20 changed files with 275 additions and 502 deletions
@@ -110,13 +110,15 @@ class QRCodeLoginScreenViewModel: QRCodeLoginScreenViewModelType, QRCodeLoginScr
case let .success(session):
MXLog.info("QR Login completed")
actionsSubject.send(.done(userSession: session))
case .failure(let error):
handleError(error: error)
case .failure(.qrCodeError(let error)):
handleError(error)
case .failure:
handleError(.unknown)
}
}
}
private func handleError(error: QRCodeLoginServiceError) {
private func handleError(_ error: QRCodeLoginError) {
MXLog.error("Failed to scan the QR code: \(error)")
switch error {
case .invalidQRCode:
@@ -137,7 +139,7 @@ class QRCodeLoginScreenViewModel: QRCodeLoginScreenViewModelType, QRCodeLoginScr
state.state = .error(.expired)
case .deviceNotSupported:
state.state = .error(.deviceNotSupported)
case .failedLoggingIn, .unknown:
case .unknown:
state.state = .error(.unknown)
}
}