mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add an OAuthPresenterHook. (#5545)
* Add an OAuthPresenterHook. * Update the enterprise submodule.
This commit is contained in:
@@ -20,6 +20,7 @@ class OAuthAccountSettingsPresenter: NSObject {
|
||||
private let redirectURL: URL
|
||||
private let presentationAnchor: UIWindow
|
||||
private let appMediator: AppMediatorProtocol
|
||||
private let appHooks: AppHooks
|
||||
|
||||
typealias Continuation = AsyncStream<Result<Void, OAuthError>>.Continuation
|
||||
private let continuation: Continuation?
|
||||
@@ -28,11 +29,13 @@ class OAuthAccountSettingsPresenter: NSObject {
|
||||
presentationAnchor: UIWindow,
|
||||
appMediator: AppMediatorProtocol,
|
||||
appSettings: AppSettings,
|
||||
appHooks: AppHooks,
|
||||
continuation: Continuation? = nil) {
|
||||
self.accountURL = accountURL
|
||||
redirectURL = appSettings.oAuthRedirectURL
|
||||
self.presentationAnchor = presentationAnchor
|
||||
self.appMediator = appMediator
|
||||
self.appHooks = appHooks
|
||||
self.continuation = continuation
|
||||
|
||||
super.init()
|
||||
@@ -40,6 +43,8 @@ class OAuthAccountSettingsPresenter: NSObject {
|
||||
|
||||
/// Presents a web authentication session for the supplied data.
|
||||
func start() {
|
||||
let accountURL = appHooks.oAuthPresenterHook.update(accountURL)
|
||||
|
||||
let session = ASWebAuthenticationSession(url: accountURL, callback: .oAuthRedirectURL(redirectURL)) { [continuation] _, error in
|
||||
guard let continuation else { return }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user