mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
ReauthenticationCoordinator: Add the possibility to start directly from a MXAuthenticationSession.
This commit is contained in:
@@ -20,6 +20,8 @@ import Foundation
|
||||
@objcMembers
|
||||
class ReauthenticationCoordinatorParameters: NSObject {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
/// The Matrix session
|
||||
let session: MXSession
|
||||
|
||||
@@ -33,18 +35,47 @@ class ReauthenticationCoordinatorParameters: NSObject {
|
||||
/// The message to use in the authentication screen if present.
|
||||
let message: String?
|
||||
|
||||
/// The authenticated API endpoint request
|
||||
let authenticatedEndpointRequest: AuthenticatedEndpointRequest
|
||||
/// The authenticated API endpoint request.
|
||||
let authenticatedEndpointRequest: AuthenticatedEndpointRequest?
|
||||
|
||||
init(session: MXSession,
|
||||
/// The MXAuthentication session retrieved from a request error.
|
||||
/// Note: If the property is not nil `authenticatedEndpointRequest` will not be taken into account.
|
||||
let authenticationSession: MXAuthenticationSession?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
convenience init(session: MXSession,
|
||||
presenter: UIViewController,
|
||||
title: String?,
|
||||
message: String?,
|
||||
authenticatedEndpointRequest: AuthenticatedEndpointRequest) {
|
||||
self.init(session: session,
|
||||
presenter: presenter,
|
||||
title: title,
|
||||
message: message,
|
||||
authenticatedEndpointRequest: authenticatedEndpointRequest,
|
||||
authenticationSession: nil)
|
||||
}
|
||||
|
||||
convenience init(session: MXSession,
|
||||
presenter: UIViewController,
|
||||
title: String?,
|
||||
message: String?,
|
||||
authenticationSession: MXAuthenticationSession) {
|
||||
self.init(session: session, presenter: presenter, title: title, message: message, authenticatedEndpointRequest: nil, authenticationSession: authenticationSession)
|
||||
}
|
||||
|
||||
private init(session: MXSession,
|
||||
presenter: UIViewController,
|
||||
title: String?,
|
||||
message: String?,
|
||||
authenticatedEndpointRequest: AuthenticatedEndpointRequest?,
|
||||
authenticationSession: MXAuthenticationSession?) {
|
||||
self.session = session
|
||||
self.presenter = presenter
|
||||
self.title = title
|
||||
self.message = message
|
||||
self.authenticatedEndpointRequest = authenticatedEndpointRequest
|
||||
self.authenticationSession = authenticationSession
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user