Impressia/Vernissage/Services/AuthorizationSession.swift

19 lines
599 B
Swift
Raw Normal View History

2023-01-29 19:11:44 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
2023-03-28 10:35:38 +02:00
// Licensed under the Apache License 2.0.
2023-01-29 19:11:44 +01:00
//
2023-01-29 19:11:44 +01:00
import Foundation
import AuthenticationServices
public class AuthorizationSession: NSObject, ObservableObject, ASWebAuthenticationPresentationContextProviding {
2023-02-03 15:16:30 +01:00
/// Presentation anchor used during showing in app browser for sign in user (OAuth).
2023-01-29 19:11:44 +01:00
public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
DispatchQueue.main.sync {
return ASPresentationAnchor()
}
}
}