Esempio n. 1
0
 /**
  * check that the nonce is not repeated
  */
 private function _checkNonce(Consumer $consumer, $nonce, $timestamp)
 {
     if (!$nonce) {
         throw new Exception('Missing nonce parameter. The parameter is required.', 400);
     }
     // verify that the nonce is uniqueish
     $found = $this->_dataStore->lookupNonce($consumer, $nonce, $timestamp);
     if ($found) {
         throw new Exception("Nonce already used: {$nonce}", 400);
     }
 }