fix: add user id header when redirecting to default app

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
Salvatore Martire 2026-02-06 20:25:20 +01:00
parent 0e944c190d
commit 2eecf81833

View file

@ -1190,7 +1190,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