You are here

private function PoptinController::poptinCheckToken in Website Popups, Email Popup, Exit-Intent Popup, and Contact Forms – Poptin 8

Implements poptin_check_csrf_token().

3 calls to PoptinController::poptinCheckToken()
PoptinController::poptinDeactivate in src/Controller/PoptinController.php
Implements poptinDeactivate().
PoptinController::poptinGeneratePoptinLink in src/Controller/PoptinController.php
Implements poptinGeneratePoptinLink().
PoptinController::poptinSignup in src/Controller/PoptinController.php
Implements poptinSignup().

File

src/Controller/PoptinController.php, line 279

Class

PoptinController
Provides route responses for the Poptin module.

Namespace

Drupal\poptin\Controller

Code

private function poptinCheckToken($token) {
  if (!empty($token)) {
    $testtoken = $this->tokenGenerator
      ->validate($token);
    if ($testtoken) {
      return TRUE;
    }
    return FALSE;
  }
  return FALSE;
}