示例#1
0
 /**
  * Create new secret.
  * 16 characters, randomly chosen from the allowed base32 characters.
  *
  * @param string $service Future feature
  * @return string
  *
  * @url GET totp/generate
  * @url GET totp/generate/{service}
  * @access protected
  */
 function totpSecret($service = NULL)
 {
     //$request_data = $this->filter->run();
     //if ($this->filter->hasErrors()) { return $this->filter->getErrorsReturn(); }
     $totp = new TOTP();
     switch ($service) {
         case 'google':
             $secret = $totp->createSecret();
             break;
         case 'authy':
             break;
         default:
             $secret = '';
             break;
     }
     return $secret;
 }