mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Fix PR remarks
This commit is contained in:
+4
-2
@@ -137,8 +137,10 @@ class AuthenticationService: NSObject {
|
||||
func reset() {
|
||||
loginWizard = nil
|
||||
registrationWizard = nil
|
||||
|
||||
self.state = AuthenticationState(flow: .login, homeserverAddress: state.homeserver.address)
|
||||
|
||||
// The previously used homeserver is re-used as `startFlow` will be called again a replace it anyway.
|
||||
let address = state.homeserver.addressFromUser ?? state.homeserver.address
|
||||
self.state = AuthenticationState(flow: .login, homeserverAddress: address)
|
||||
}
|
||||
|
||||
/// Continues an SSO flow when completion comes via a deep link.
|
||||
|
||||
+8
-9
@@ -63,18 +63,17 @@ struct AuthenticationState {
|
||||
AuthenticationHomeserverViewData(address: displayableAddress,
|
||||
isMatrixDotOrg: isMatrixDotOrg,
|
||||
showLoginForm: preferredLoginMode.supportsPasswordFlow,
|
||||
showRegistrationForm: registrationFlow != nil,
|
||||
showRegistrationForm: registrationFlow != nil && !needsRegistrationFallback,
|
||||
ssoIdentityProviders: preferredLoginMode.ssoIdentityProviders ?? [])
|
||||
}
|
||||
|
||||
/// Needs authentication fallback for login or registration
|
||||
var needsFallback: Bool {
|
||||
switch preferredLoginMode {
|
||||
case .unsupported:
|
||||
return true
|
||||
default:
|
||||
break
|
||||
}
|
||||
/// Needs authentication fallback for login
|
||||
var needsLoginFallback: Bool {
|
||||
return preferredLoginMode.isUnsupported
|
||||
}
|
||||
|
||||
/// Needs authentication fallback for registration
|
||||
var needsRegistrationFallback: Bool {
|
||||
guard let flow = registrationFlow else {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -75,6 +75,15 @@ enum LoginMode {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
var isUnsupported: Bool {
|
||||
switch self {
|
||||
case .unsupported:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Data obtained when calling `LoginWizard.resetPassword` that will be used
|
||||
|
||||
Reference in New Issue
Block a user