PartKeepr\SetupBundle\Controller\SetupController::generateAuthKeyAction PHP Method

generateAuthKeyAction() public method

    public function generateAuthKeyAction()
    {
        $response = ['success' => true, 'message' => 'Auth key successfully generated', 'errors' => []];
        $parameters = ['authkey' => $this->get('partkeepr.setup.config_service')->generateSecret()];
        $contents = $this->container->get('templating')->render('PartKeeprSetupBundle::authkey.php.twig', $parameters);
        file_put_contents($this->get('partkeepr.setup.config_service')->getAuthKeyPath(), $contents);
        return new JsonResponse($response);
    }