Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Revert "Fix Inspecting ViewController on non-main thread (auth0#318)"
Browse files Browse the repository at this point in the history
This reverts commit b7015da.
  • Loading branch information
sam-w committed Mar 11, 2020
1 parent 8d42279 commit 04630fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Auth0/SafariWebAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,16 @@ class SafariWebAuth: WebAuth {
}

let finish: (Result<Credentials>) -> Void = { [weak controller] (result: Result<Credentials>) -> Void in
guard let presenting = controller?.presentingViewController else {
return callback(Result.failure(error: WebAuthError.cannotDismissWebAuthController))
}

if case .failure(let cause as WebAuthError) = result, case .userCancelled = cause {
DispatchQueue.main.async {
callback(result)
}
} else {
DispatchQueue.main.async {
guard let presenting = controller?.presentingViewController else {
return callback(Result.failure(error: WebAuthError.cannotDismissWebAuthController))
}
presenting.dismiss(animated: true) {
callback(result)
}
Expand Down

0 comments on commit 04630fe

Please sign in to comment.