You are here

JwtAuthGenerateEvent.php in JSON Web Token Authentication (JWT) 8.0

Same filename and directory in other branches
  1. 8 src/Authentication/Event/JwtAuthGenerateEvent.php

File

src/Authentication/Event/JwtAuthGenerateEvent.php
View source
<?php

namespace Drupal\jwt\Authentication\Event;


/**
 * Class JwtAuthGenerateEvent.
 *
 * @package Drupal\jwt\Authentication\Event
 */
class JwtAuthGenerateEvent extends JwtAuthBaseEvent {

  /**
   * Adds a claim to a JsonWebToken.
   *
   * @see \Drupal\jwt\JsonWebToken\JsonWebTokenInterface::setClaim()
   */
  public function addClaim($claim, $value) {
    $this->jwt
      ->setClaim($claim, $value);
  }

  /**
   * Removes a claim from a JsonWebToken.
   *
   * @see \Drupal\jwt\JsonWebToken\JsonWebTokenInterface::unsetClaim()
   */
  public function removeClaim($claim) {
    $this->jwt
      ->unsetClaim($claim);
  }

}

Classes

Namesort descending Description
JwtAuthGenerateEvent Class JwtAuthGenerateEvent.