From b69c40345fb9738cc995535a0fc4bb8922152e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 8 Mar 2025 18:45:38 +0100 Subject: [PATCH] Improve docs --- app/controllers/general.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index f6352bcd29..4e5e41b16c 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -158,7 +158,17 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $protocol = $request->getProtocol(); - // Ensure preview authorization + /** + Ensure preview authorization + - Authorization is skippable for tests, and build screenshot + - If cookie is not sent by client -> not authorized + - If JWT in cookie is invalid or expired -> not authorized + - If user is blocked or removed -> not authorized + - If user's session is removed or expired -> not authorized + - If user is not member of team of this deployment -> not authorized + - If not authorized, redirect to Console redirect UI + - If authorized, continue as if auth was not required + */ $requirePreview = \is_null($apiKey) || !$apiKey->isPreviewAuthDisabled(); if ($isPreview && $requirePreview) { $cookie = $request->getCookie(Auth::$cookieNamePreview, '');