File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
WooCommerce/Classes/Authentication Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,14 @@ private extension AuthenticatedWebViewController {
105105
106106 webView. publisher ( for: \. url)
107107 . sink { [ weak self] url in
108- if url? . absoluteString. contains ( WKWebView . wporgNoncePath) == true {
109- self ? . loadContent ( )
108+ guard let self else { return }
109+ let initialURL = self . viewModel. initialURL
110+ // avoids infinite loop if the initial url happens to be the nonce retrieval path.
111+ if url? . absoluteString. contains ( WKWebView . wporgNoncePath) == true ,
112+ initialURL? . absoluteString. contains ( WKWebView . wporgNoncePath) != true {
113+ self . loadContent ( )
110114 } else {
111- self ? . viewModel. handleRedirect ( for: url)
115+ self . viewModel. handleRedirect ( for: url)
112116 }
113117 }
114118 . store ( in: & subscriptions)
You can’t perform that action at this time.
0 commit comments