p2 / OAuth2

OAuth2 framework for macOS and iOS, written in Swift.
Other
1.14k stars 278 forks source link

Fix implementation of `ASWebAuthenticationPresentationContextProviding` protocol #357

Closed cgossain closed 3 years ago

cgossain commented 3 years ago

This protocol expects an ASPresentationAnchor to be returned (which is a UIWindow on iOS, or NSWindow on Mac OS). This commit updates the implementation to return the window object associated with the view of the authorizeContext (and assumes the authorize context is an instance of UIViewController).

This change is in line with Apple’s example documentation: https://developer.apple.com/documentation/authenticationservices/authenticating_a_user_through_a_web_service

ossus-lib commented 3 years ago

Ah, nice. Can you fix it to use tabs instead of spaces?

cgossain commented 3 years ago

Ah yes, I'll try to do an interactive rebase to fix.

cgossain commented 3 years ago

@ossus-lib Ok I've done an interactive rebase and formatted the commits using tabs instead of spaces. I force pushed the changes.

cgossain commented 3 years ago

@ossus-lib Ok I think I got it this time. I just changed my indentation settings in Xcode.