You are here

public function JwtAuthValidateEvent::invalidate in JSON Web Token Authentication (JWT) 8.0

Same name and namespace in other branches
  1. 8 src/Authentication/Event/JwtAuthValidateEvent.php \Drupal\jwt\Authentication\Event\JwtAuthValidateEvent::invalidate()

Marks a token as invalid and stops further propagation of the event.

This marks a given token as invalid. You should provide a reason for invalidating the token. This message will not be kept private, so one should be cautious of leaking secure information here.

Parameters

string $reason: The reason that this token was invalidated.

File

src/Authentication/Event/JwtAuthValidateEvent.php, line 36

Class

JwtAuthValidateEvent
Class JwtAuthValidateEvent.

Namespace

Drupal\jwt\Authentication\Event

Code

public function invalidate($reason) {
  $this->valid = FALSE;
  $this->invalidReason = $reason;
  $this
    ->stopPropagation();
}