fix: add user id header when redirecting to default app

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
pull/58144/head
Salvatore Martire 6 months ago
parent 0e944c190d
commit 2eecf81833
  1. 4
      lib/base.php

@ -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

Loading…
Cancel
Save