Skip to content

Commit

Permalink
Remove AuthTransaction extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Nov 2, 2021
1 parent 8aaa773 commit 24aa79b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Auth0/BaseCallbackTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BaseCallbackTransaction: NSObject, AuthTransaction {
self.callback(false)
}

func handleUrl(_ url: URL) -> Bool {
func resume(_ url: URL) -> Bool {
self.callback(true)
return true
}
Expand Down
8 changes: 0 additions & 8 deletions Auth0/DesktopWebAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ public protocol AuthResumable {

}

extension AuthTransaction where Self: BaseCallbackTransaction {

func resume(_ url: URL) -> Bool {
return self.handleUrl(url)
}

}

#if swift(>=5.1)
extension ASTransaction: ASWebAuthenticationPresentationContextProviding {

Expand Down
28 changes: 2 additions & 26 deletions Auth0/MobileWebAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public extension _ObjectiveOAuth2 {
*/
@objc(resumeAuthWithURL:options:)
static func resume(_ url: URL, options: [A0URLOptionsKey: Any]) -> Bool {
return resumeAuth(url, options: options)
return resumeAuth(url)
}

}
Expand All @@ -72,31 +72,7 @@ public protocol AuthResumable {

- returns: if the url was expected and properly formatted otherwise it will return `false`.
*/
func resume(_ url: URL, options: [A0URLOptionsKey: Any]) -> Bool

}

public extension AuthResumable {

/**
Tries to resume (and complete) the OAuth2 session from the received URL

- parameter url: url received in application's AppDelegate
- parameter options: a dictionary of launch options received from application's AppDelegate

- returns: `true` if the url completed (successfully or not) this session, `false` otherwise
*/
func resume(_ url: URL, options: [A0URLOptionsKey: Any] = [:]) -> Bool {
return self.resume(url, options: options)
}

}

extension AuthTransaction where Self: BaseCallbackTransaction {

func resume(_ url: URL, options: [A0URLOptionsKey: Any]) -> Bool {
return self.handleUrl(url)
}
func resume(_ url: URL) -> Bool

}

Expand Down

0 comments on commit 24aa79b

Please sign in to comment.