Skip to content

Commit d14beed

Browse files
committed
Fix OAuth2CustomAuthorizer
1 parent 840d6ea commit d14beed

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Sources/Base/OAuth2CustomAuthorizerUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol OAuth2CustomAuthorizerUI {
3131
- parameter fromContext: The presenting context, typically another controller of platform-dependent type
3232
- parameter animated: Whether the presentation should be animated
3333
*/
34-
func present(loginController: AnyObject?, fromContext context: AnyObject?, animated: Bool) throws
34+
func present(loginController: AnyObject, fromContext context: AnyObject?, animated: Bool) throws
3535

3636
/**
3737
This function must dismiss the login controller.

Sources/iOS/OAuth2CustomAuthorizer+iOS.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class OAuth2CustomAuthorizer: OAuth2CustomAuthorizerUI {
4545
- parameter context: The parent controller to use to present the login controller.
4646
- parameter animated: Whether the presentation should be animated.
4747
*/
48-
public func present(loginController: OAuth2LoginController, fromContext context: AnyObject?, animated: Bool) throws {
48+
public func present(loginController: AnyObject, fromContext context: AnyObject?, animated: Bool) throws {
4949
guard let parentController = context as? UIViewController else {
5050
throw context == nil ? OAuth2Error.noAuthorizationContext : OAuth2Error.invalidAuthorizationContext
5151
}

Sources/macOS/OAuth2CustomAuthorizer+macOS.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ public class OAuth2CustomAuthorizer: OAuth2CustomAuthorizerUI {
4646
- parameter fromContext: The controller to which present the login controller. Should be a `NSViewController`
4747
- parameter animated: Whether the presentation should be animated.
4848
*/
49-
public func present(loginController: AnyObject?, fromContext context: AnyObject?, animated: Bool) throws {
49+
public func present(loginController: AnyObject, fromContext context: AnyObject?, animated: Bool) throws {
5050
guard #available(macOS 10.10, *) else {
5151
throw OAuth2Error.generic("Native authorizing is only available in OS X 10.10 and later")
5252
}
53-
5453
guard let parentController = context as? NSViewController else {
5554
throw context == nil ? OAuth2Error.noAuthorizationContext : OAuth2Error.invalidAuthorizationContext
5655
}
57-
5856
guard let controller = loginController as? NSViewController else {
5957
throw OAuth2Error.invalidLoginController(actualType: String(describing: type(of: loginController)),
6058
expectedType: String(describing: NSViewController.self))

0 commit comments

Comments
 (0)