Skip to content

Commit

Permalink
address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzNotABug committed Dec 11, 2024
1 parent 3c0ec71 commit cf40bb0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/swift/Sources/OAuth/WebAuthComponent.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ class PresentationContextProvider: NSObject, ASWebAuthenticationPresentationCont
static let shared = PresentationContextProvider()

func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
if let mainWindow = windowScene.windows.first {
return mainWindow
}
}

return ASPresentationAnchor()
}
}
Expand Down

0 comments on commit cf40bb0

Please sign in to comment.