public function actionDownloadTranslations($id, $hash) { $project = $this->projectFacade->find($id); $verifyHash = hash_hmac('sha256', $id, $project->getKey()); if ($hash === $verifyHash) { $this->buildFiles($project); } else { $this->sendResponse(new \Nette\Application\Responses\JsonResponse(['error' => 'true', 'message' => 'Bad request. Hash does not match.'])); } $this->terminate(); }