message = _('The token provided is not valid anymore'); $this->app = $app; $this->random = $random; parent::__construct(); } public function isValid($token) { try { $data = $this->random->helloToken($token); } catch (\Exception_NotFound $e) { return false; } return \random::TYPE_PASSWORD === $data['type']; } }