     }
     
     fileprivate func token() -> String {
-        if useBackupOathToken {
+        switch displayMode {
+        case .longAlphaNumeric:
             return backupOathTokenField.text!
-        }else{
+        case .shortNumeric:
             return oathTokenFields.reduce("", { $0 + ($1.text ?? "") })
         }
     }


import UIKit

fileprivate enum NextFirstResponderDirection: Int {
    case forward = 1
    case reverse = -1
}

class WMFTwoFactorPasswordViewController: WMFScrollViewController, UITextFieldDelegate, WMFDeleteBackwardReportingTextFieldDelegate {

    }
    
    fileprivate func areRequiredFieldsPopulated() -> Bool {
        switch displayMode {
        case .longAlphaNumeric:
            guard
                let backupToken = backupOathTokenField.text,
                backupToken.characters.count > 0
            else {
                return false
            }
            return true
        case .shortNumeric:
            return oathTokenFields.first(where:{ $0.text?.characters.count == 0 }) == nil
        }
    }
    
    @IBAction func textFieldDidChange(_ sender: UITextField) {
        enableProgressiveButton(areRequiredFieldsPopulated())
        guard
            displayMode == .shortNumeric,
            let text = sender.text,
            text.characters.count > 0
        else {
            return
        }
        makeNextTextFieldFirstResponder(currentTextField: sender, direction: .forward)
    }
    
    fileprivate func makeNextTextFieldFirstResponder(currentTextField: UITextField, direction: WMFTwoFactorNextFirstResponderDirection) {
        guard let index = oathTokenFields.index(of: currentTextField) else {
            return
        }
