Esempio n. 1
0
 /**
  * Get the timestamp when the blacklist comes into effect
  * This defaults to immediate (0 seconds)
  *
  * @return integer
  */
 protected function getGraceTimestamp()
 {
     return (int) Utils::now()->addSeconds($this->gracePeriod)->format('U');
 }
Esempio n. 2
0
 /**
  * Get the Not Before (nbf) claim.
  *
  * @return int
  */
 public function nbf()
 {
     return Utils::now()->getTimestamp();
 }
Esempio n. 3
0
 /**
  * Get the Not Before (nbf) claim
  *
  * @return int
  */
 public function nbf()
 {
     return (int) Utils::now()->format('U');
 }
Esempio n. 4
0
 /**
  * Check the token in the refresh flow context
  *
  * @param  $payload
  *
  * @throws \Tymon\JWTAuth\Exceptions\TokenExpiredException
  *
  * @return bool
  */
 protected function validateRefresh(array $payload)
 {
     if (isset($payload['iat']) && Utils::timestamp($payload['iat'])->diffInMinutes(Utils::now()) >= $this->refreshTTL) {
         throw new TokenExpiredException('Token has expired and can no longer be refreshed');
     }
     return true;
 }
Esempio n. 5
0
 /**
  * Get the timestamp when the blacklist comes into effect
  * This defaults to immediate (0 seconds).
  *
  * @return int
  */
 protected function getGraceTimestamp()
 {
     return Utils::now()->addSeconds($this->gracePeriod)->getTimestamp();
 }