Skip to content

Commit 47bcebd

Browse files
committed
address comments.
1 parent 7667db2 commit 47bcebd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

templates/swift/Sources/OAuth/WebAuthComponent.swift.twig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,8 @@ class PresentationContextProvider: NSObject, ASWebAuthenticationPresentationCont
161161
static let shared = PresentationContextProvider()
162162

163163
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
164-
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
165-
if let mainWindow = windowScene.windows.first {
166-
return mainWindow
167-
}
164+
if let mainWindow = OSApplication.shared.windows.first { $0.isKeyWindow } {
165+
return mainWindow
168166
}
169167

170168
return ASPresentationAnchor()

0 commit comments

Comments
 (0)