original_string: public function isInputtedTwoFactorAuthCodeCorrect($userId=null) {
          $inputted2faCode = $this->request->input('2facode');
  
          if (isset($userId)) {
              $sent2faCode     = $this->getUserSmsToken($userId);
          } else {
              $sent2faCode     = $this->request->session()->get('codeToInput');
          }
  
  
          if ($inputted2faCode == $sent2faCode) {
              return true;
          }
  
          return false;
      }
code: public function isInputtedTwoFactorAuthCodeCorrect($userId=null) {
          $inputted2faCode = $this->request->input('2facode');
  
          if (isset($userId)) {
              $sent2faCode     = $this->getUserSmsToken($userId);
          } else {
              $sent2faCode     = $this->request->session()->get('codeToInput');
          }
  
  
          if ($inputted2faCode == $sent2faCode) {
              return true;
          }
  
          return false;
      }
code_tokens: public function isInputtedTwoFactorAuthCodeCorrect ( $ userId = null ) { $ inputted2faCode = $ this -> request -> input ( '2facode' ) ; if ( isset ( $ userId ) ) { $ sent2faCode = $ this -> getUserSmsToken ( $ userId ) ; } else { $ sent2faCode = $ this -> request -> session ( ) -> get ( 'codeToInput' ) ; } if ( $ inputted2faCode == $ sent2faCode ) { return true ; } return false ; }
docstring: Did the user input the correct 2FA code?
  
  @param  int    $userId                      User ID --> if null, then called by 2FA registration;
  otherwise, called by 2FA login
  
  @return bool
docstring_tokens: Did the user input the correct 2FA code?