repod/lib/Controller/PageController.php
Michel Roux 010550fa60
All checks were successful
repod / xml (push) Successful in 13s
repod / php (push) Successful in 39s
repod / nodejs (push) Successful in 1m20s
repod / release (push) Has been skipped
refactor: ♻️ app-template refacto part 2
2024-05-29 17:55:14 +02:00

32 lines
677 B
PHP

<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Util;
class PageController extends Controller
{
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(Application::APP_ID, 'main');
$csp = new ContentSecurityPolicy();
$csp->addAllowedImageDomain('*');
$csp->addAllowedMediaDomain('*');
$response = new TemplateResponse(Application::APP_ID, 'index');
$response->setContentSecurityPolicy($csp);
return $response;
}
}