 
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        
+        captchaViewController = WMFCaptchaViewController.wmf_initialViewControllerFromClassStoryboard()
+        captchaViewController?.captchaDelegate = self
+        wmf_addChildController(captchaViewController, andConstrainToEdgesOfContainerView: captchaContainer)
+        
+        // Check if captcha is required right away. Things could be configured so captcha is required at all times.
+        getCaptcha()
+        
         enableProgressiveButtonIfNecessary()
     }
     

    }
    
    fileprivate func shouldProgressiveButtonBeEnabled() -> Bool {
        return areRequiredFieldsPopulated()
/*
        var shouldEnable = areRequiredFieldsPopulated()
        if showCaptchaContainer && shouldEnable {
            shouldEnable = hasUserEnteredCaptchaText()
        }
        return shouldEnable
*/
    }
    
    fileprivate func requiredInputFields() -> [UITextField] {

        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:
