diff --git a/Sources/LinkedIn/WebView/LinkedInWebView.swift b/Sources/LinkedIn/WebView/LinkedInWebView.swift index 921125c..08de2c2 100644 --- a/Sources/LinkedIn/WebView/LinkedInWebView.swift +++ b/Sources/LinkedIn/WebView/LinkedInWebView.swift @@ -77,8 +77,8 @@ 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 } @@ -86,7 +86,7 @@ public extension LinkedInWebView { 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 { @@ -96,7 +96,7 @@ public extension LinkedInWebView { // return // } parent.onSuccess?((code.value ?? "", parent.requestState)) - decisionHandler(.allow) + decisionHandler(.cancel) parent.dismiss() } }