aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller/CheckSetupController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/lib/Controller/CheckSetupController.php')
-rw-r--r--apps/settings/lib/Controller/CheckSetupController.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 5dcf6cda29c..c2e397c502e 100644
--- a/apps/settings/lib/Controller/CheckSetupController.php
+++ b/apps/settings/lib/Controller/CheckSetupController.php
@@ -74,6 +74,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\DB\Events\AddMissingColumnsEvent;
use OCP\DB\Events\AddMissingIndicesEvent;
@@ -94,6 +95,8 @@ use OCP\Notification\IManager;
use OCP\Security\Bruteforce\IThrottler;
use OCP\Security\ISecureRandom;
use Psr\Log\LoggerInterface;
+use function setcookie;
+use function time;
#[IgnoreOpenAPI]
class CheckSetupController extends Controller {
@@ -972,4 +975,19 @@ Raw output
]
);
}
+
+ /**
+ * @AuthorizedAdminSetting(settings=OCA\Settings\Settings\Admin\Overview)
+ */
+ public function checkCookies(): JSONResponse {
+ $rand = $this->secureRandom->generate(32);
+ setcookie(
+ 'nc_setup_check',
+ $rand,
+ time() + 60
+ );
+ return new JSONResponse([
+ 'rand' => $rand,
+ ]);
+ }
}