public function set(TokenInterface $token) : StorageInterface { $this->tokens[$token->getId()] = $token; return $this; }
/** * * {@inheritDoc} * * @see \Nia\Security\Csrf\Manager\ManagerInterface::isTokenValid($token) */ public function isTokenValid(TokenInterface $token) : bool { $tokenId = $token->getId(); if (!$this->hasToken($tokenId)) { return false; } return hash_equals($this->getToken($tokenId)->getValue(), $token->getValue()); }