mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Show an alert when entering an account provider that requires Element Pro. (#4326)
This commit is contained in:
@@ -25,11 +25,18 @@ extension AuthenticationClientFactoryMock {
|
||||
supportsOIDCCreatePrompt: false,
|
||||
supportsPasswordLogin: false)),
|
||||
"server.net": ClientSDKMock(configuration: .init(serverAddress: "server.net",
|
||||
homeserverURL: "https://matrix.example.com",
|
||||
homeserverURL: "https://matrix.server.net",
|
||||
slidingSyncVersion: .native,
|
||||
oidcLoginURL: nil,
|
||||
supportsOIDCCreatePrompt: false,
|
||||
supportsPasswordLogin: false))
|
||||
supportsPasswordLogin: false)),
|
||||
"secure.gov": ClientSDKMock(configuration: .init(serverAddress: "secure.gov",
|
||||
homeserverURL: "https://ess.secure.gov",
|
||||
slidingSyncVersion: .native,
|
||||
oidcLoginURL: "https://auth.secure.gov/oidc",
|
||||
supportsOIDCCreatePrompt: false,
|
||||
supportsPasswordLogin: false,
|
||||
elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}"))
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ extension ClientSDKMock {
|
||||
var oidcLoginURL: String? = "https://account.matrix.org/authorize"
|
||||
var supportsOIDCCreatePrompt = true
|
||||
var supportsPasswordLogin = true
|
||||
var elementWellKnown: String?
|
||||
var validCredentials = (username: "alice", password: "12345678")
|
||||
|
||||
// MARK: Session
|
||||
@@ -51,6 +52,14 @@ extension ClientSDKMock {
|
||||
|
||||
userIdReturnValue = configuration.userID
|
||||
sessionReturnValue = configuration.session
|
||||
getUrlUrlClosure = { url in
|
||||
guard url.contains(".well-known/element/element.json") else { throw MockError.generic }
|
||||
if let elementWellKnown = configuration.elementWellKnown {
|
||||
return elementWellKnown
|
||||
} else {
|
||||
throw MockError.generic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user