mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Merge commit 'a8c505c2f9175ae0bece1f62708e6fc31e587897' into feature/3746_merge_element_1.9.10
# Conflicts: # Config/AppConfiguration.swift # Config/AppVersion.xcconfig # Podfile.lock # Riot/Modules/Application/AppCoordinator.swift # Riot/Modules/Common/Avatar/AvatarView.swift # Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellProvider.m # Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellProvider.m # Riot/Modules/Settings/Security/SecurityViewController.m # Riot/Modules/Settings/SettingsViewController.m # Riot/Modules/TabBar/TabBarCoordinator.swift # Riot/target.yml # fastlane/Fastfile # project.yml
This commit is contained in:
+6
@@ -34,6 +34,8 @@ protocol AuthenticationRestClient: AnyObject {
|
||||
func login(parameters: LoginParameters) async throws -> MXCredentials
|
||||
func login(parameters: [String: Any]) async throws -> MXCredentials
|
||||
|
||||
func generateLoginToken() async throws -> MXLoginToken
|
||||
|
||||
// MARK: Registration
|
||||
|
||||
var registerFallbackURL: URL { get }
|
||||
@@ -48,6 +50,10 @@ protocol AuthenticationRestClient: AnyObject {
|
||||
func forgetPassword(for email: String, clientSecret: String, sendAttempt: UInt) async throws -> String
|
||||
func resetPassword(parameters: CheckResetPasswordParameters) async throws
|
||||
func resetPassword(parameters: [String: Any]) async throws
|
||||
|
||||
// MARK: Versions
|
||||
|
||||
func supportedMatrixVersions() async throws -> MXMatrixVersions
|
||||
}
|
||||
|
||||
extension MXRestClient: AuthenticationRestClient { }
|
||||
|
||||
+5
-1
@@ -260,9 +260,13 @@ class AuthenticationService: NSObject {
|
||||
|
||||
let loginFlow = try await getLoginFlowResult(client: client)
|
||||
|
||||
let supportsQRLogin = try await QRLoginService(client: client,
|
||||
mode: .notAuthenticated).isServiceAvailable()
|
||||
|
||||
let homeserver = AuthenticationState.Homeserver(address: loginFlow.homeserverAddress,
|
||||
addressFromUser: homeserverAddress,
|
||||
preferredLoginMode: loginFlow.loginMode)
|
||||
preferredLoginMode: loginFlow.loginMode,
|
||||
supportsQRLogin: supportsQRLogin)
|
||||
return (client, homeserver)
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ struct AuthenticationState {
|
||||
|
||||
/// The preferred login mode for the server
|
||||
var preferredLoginMode: LoginMode = .unknown
|
||||
|
||||
/// Flag indicating whether the homeserver supports logging in via a QR code.
|
||||
var supportsQRLogin = false
|
||||
|
||||
/// The response returned when querying the homeserver for registration flows.
|
||||
var registrationFlow: RegistrationResult?
|
||||
@@ -67,6 +70,7 @@ struct AuthenticationState {
|
||||
AuthenticationHomeserverViewData(address: displayableAddress,
|
||||
showLoginForm: preferredLoginMode.supportsPasswordFlow,
|
||||
showRegistrationForm: registrationFlow != nil && !needsRegistrationFallback,
|
||||
showQRLogin: supportsQRLogin,
|
||||
ssoIdentityProviders: preferredLoginMode.ssoIdentityProviders ?? [])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user