Skip to content

Commit

Permalink
+1
Browse files Browse the repository at this point in the history
  • Loading branch information
borut-t committed Sep 20, 2023
1 parent e8c112b commit 21fd260
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/LinkedIn/WebView/LinkedInWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct LinkedInWebView: UIViewRepresentable {
self.onSuccess = onSuccess
self.onFailure = onFailure

webView.navigationDelegate = makeCoordinator()
// webView.navigationDelegate = makeCoordinator()
}

public func makeUIView(context: Context) -> some UIView {
Expand Down Expand Up @@ -78,15 +78,15 @@ public extension LinkedInWebView {

print("URL", webView.url?.absoluteString)
guard let url = webView.url /*, url.host == parent.configuration.redirectUrl.host*/ else {
decisionHandler(.cancel)
decisionHandler(.allow)
return
}

// extract the authorization code
let components = URLComponents(string: url.absoluteString)
guard let state = components?.queryItems?.first(where: { $0.name == "state" }),
let code = components?.queryItems?.first(where: { $0.name == "code" }) else {
decisionHandler(.cancel)
decisionHandler(.allow)
return
}
// guard requestState == state.value ?? "" else {
Expand Down

0 comments on commit 21fd260

Please sign in to comment.