             presenter.present(navigationController, animated: true, completion: nil)
         })
     }
+    
+    fileprivate func getCaptcha() {
+        let captchaFailure: WMFErrorHandler = {error in
+            WMFAlertManager.sharedInstance.showErrorAlert(error as NSError, sticky: true, dismissPreviousAlerts: true, tapCallBack: nil)
+            self.funnel?.logError(error.localizedDescription)
+        }
+        let siteURL = MWKLanguageLinkController.sharedInstance().appLanguage?.siteURL()
+        loginInfoFetcher.fetchLoginInfoForSiteURL(siteURL!, success: { info in
+            self.captchaViewController?.captcha = info.captcha
+//          self.showCaptchaContainer = true
+            self.enableProgressiveButtonIfNecessary()
+        }, failure: captchaFailure)
+    }
+
+    func captchaReloadPushed(_ sender: AnyObject) {
+        self.enableProgressiveButtonIfNecessary()
+    }
+    
+    func captchaSolutionChanged(_ sender: AnyObject, solutionText: String?) {
+        enableProgressiveButtonIfNecessary()
+    }
+    
+    public func captchaSiteURL() -> URL {
+        return (MWKLanguageLinkController.sharedInstance().appLanguage?.siteURL())!
+    }
 }


    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        enableProgressiveButtonIfNecessary()
    }
    

        wmf_hideKeyboard()
        disableProgressiveButton()
        WMFAlertManager.sharedInstance.dismissAlert()
        WMFAuthenticationManager.sharedInstance.login(username: usernameField.text!, password: passwordField.text!, retypePassword:nil, oathToken:nil, captchaID: captchaViewController?.captcha?.captchaID, captchaWord: captchaViewController?.solution, success: { _ in
            let loggedInMessage = localizedStringForKeyFallingBackOnEnglish("main-menu-account-title-logged-in").replacingOccurrences(of: "$1", with: self.usernameField.text!)
            WMFAlertManager.sharedInstance.showSuccessAlert(loggedInMessage, sticky: false, dismissPreviousAlerts: true, tapCallBack: nil)
            self.dismiss(animated: true, completion: nil)
            self.funnel?.logSuccess()
        }, failure: { error in

            // Captcha's appear to be one-time, so always try to get a new one on failure.
            self.getCaptcha()
            
            if let error = error as? WMFAccountLoginError {
                switch error {
                case .temporaryPasswordNeedsChange:
