From 48b79ce739e9314f9b4f52356f875952f47a1a64 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Fri, 6 Feb 2026 20:25:20 +0100 Subject: [PATCH] fix: add user id header when redirecting to default app Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- lib/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 35b6fb6b98e..cc689c564a4 100644 --- a/lib/base.php +++ b/lib/base.php @@ -1098,7 +1098,9 @@ class OC { // Redirect to the default app or login only as an entry point if ($requestPath === '') { // Someone is logged in - if (Server::get(IUserSession::class)->isLoggedIn()) { + $userSession = Server::get(IUserSession::class); + if ($userSession->isLoggedIn()) { + header('X-User-Id: ' . $userSession->getUser()?->getUID()); header('Location: ' . Server::get(IURLGenerator::class)->linkToDefaultPageUrl()); } else { // Not handled and not logged in