Skip to content

Commit

Permalink
Fixes some issues with LoginSiteAddressViewController.swift.
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed May 3, 2019
1 parent 1a1553e commit 945564d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,16 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
view.endEditing(true)
displayError(message: "")

let siteAddress = WordPressAuthenticator.baseSiteURL(string: loginFields.siteAddress)
// We need to to this here because before this point we need the URL to be pre-validated
// exactly as the user inputs it, and after this point we need the URL to be the base site URL.
// This isn't really great, but it's the only sane solution I could come up with given the current
// architecture of this pod.
loginFields.siteAddress = WordPressAuthenticator.baseSiteURL(string: loginFields.siteAddress)

configureViewLoading(true)

let facade = WordPressXMLRPCAPIFacade()
facade.guessXMLRPCURL(forSite: siteAddress, success: { [weak self] (url) in
facade.guessXMLRPCURL(forSite: loginFields.siteAddress, success: { [weak self] (url) in
// Success! We now know that we have a valid XML-RPC endpoint.
// At this point, we do NOT know if this is a WP.com site or a self-hosted site.
if let url = url {
Expand Down

0 comments on commit 945564d

Please sign in to comment.