예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntityInterface)
 {
     $refreshTokenModel = new RefreshTokensModel();
     $refreshTokenModel->id = $refreshTokenEntityInterface->getIdentifier();
     $refreshTokenModel->access_token_id = $refreshTokenEntityInterface->getAccessToken()->getIdentifier();
     $refreshTokenModel->expire_time = $refreshTokenEntityInterface->getExpiryDateTime()->getTimestamp();
     $refreshTokenModel->save();
 }
예제 #2
0
 /**
  * Create a new refresh token_name.
  *
  * @param \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface $refreshTokenEntity
  */
 public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
 {
     $refreshToken = new \Ivyhjk\OAuth2\Server\Adapter\Phalcon\Model\RefreshToken();
     $refreshToken->id = $refreshTokenEntity->getIdentifier();
     $refreshToken->access_token_id = $refreshTokenEntity->getAccessToken()->getIdentifier();
     $refreshToken->expire_time = $refreshTokenEntity->getExpiryDateTime()->format('Y-m-d H:i:s');
     if (!$refreshToken->save()) {
         prx($refreshToken->getMessages());
     }
 }
 public function persistNewRefreshToken(RefreshTokenEntityInterface $entity)
 {
     $entity->save();
 }
 /**
  * @inheritDoc
  */
 public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
 {
     $this->conn->insert($this->getTableName(), ['id' => $refreshTokenEntity->getIdentifier(), 'expires_at' => $refreshTokenEntity->getExpiryDateTime(), 'accesstoken_id' => $refreshTokenEntity->getAccessToken()->getIdentifier()], ['string', 'datetime', 'string']);
 }