Skip to content

Commit cf40bb0

Browse files
committed
address comments.
1 parent 3c0ec71 commit cf40bb0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ 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+
}
168+
}
169+
164170
return ASPresentationAnchor()
165171
}
166172
}

0 commit comments

Comments
 (0)