/** * {@inheritdoc} */ public function isTokenValid(CsrfToken $token) { if (!$this->storage->hasToken($token->getId())) { return false; } return hash_equals($this->storage->getToken($token->getId()), $token->getValue()); }
/** * Tests if a CSRF token is stored. * * @return bool */ private function hasStoredCsrfToken() { if (!isset($this->csrfTokenStorage)) { return true; } return $this->csrfTokenStorage->hasToken($this->csrfTokenIntention); }