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 e2afcb6 commit e8c112b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/LinkedIn/WebView/LinkedInWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ public extension LinkedInWebView {
}

print("URL", webView.url?.absoluteString)
guard let url = webView.url, url.host == parent.configuration.redirectUrl.host else {
decisionHandler(.allow)
guard let url = webView.url /*, url.host == parent.configuration.redirectUrl.host*/ else {
decisionHandler(.cancel)
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(.allow)
decisionHandler(.cancel)
return
}
// guard requestState == state.value ?? "" else {
Expand All @@ -96,7 +96,7 @@ public extension LinkedInWebView {
// return
// }
parent.onSuccess?((code.value ?? "", parent.requestState))
decisionHandler(.allow)
decisionHandler(.cancel)
parent.dismiss()
}
}
Expand Down

0 comments on commit e8c112b

Please sign in to comment.