Skip to content

Commit

Permalink
fix(WebViewController): Fix user getting logged out on public links
Browse files Browse the repository at this point in the history
fixes #2086
fixes #2067

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Dec 10, 2023
1 parent e7b79f3 commit 4ca639d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Controller/BookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function __construct(
$this->lockManager = $lockManager;

$this->authorizer->setCORS(true);
\OC_User::setIncognitoMode(true);
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/FoldersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function __construct($appName, $request, FolderMapper $folderMapper, Publ
$this->logger = $logger;

$this->authorizer->setCORS(true);
\OC_User::setIncognitoMode(true);
$this->userManager = $userManager;
}

Expand Down
1 change: 1 addition & 0 deletions lib/Controller/InternalBookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function __construct(
$authorizer->setUserId($this->userId);
}
$authorizer->setCORS(false);
\OC_User::setIncognitoMode(false);
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/InternalFoldersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function __construct($appName, $request, $userId, FoldersController $cont
$authorizer->setUserId($userId);
}
$authorizer->setCORS(false);
\OC_User::setIncognitoMode(false);
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/InternalTagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class InternalTagsController extends ApiController {
public function __construct($appName, $request, TagsController $publicController) {
parent::__construct($appName, $request);
$this->publicController = $publicController;
\OC_User::setIncognitoMode(false);
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function __construct($appName, $request, $userId, DB\TagMapper $tagMapper
parent::__construct($appName, $request);
$this->userId = $userId;
$this->tagMapper = $tagMapper;
\OC_User::setIncognitoMode(true);
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/WebViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public function index(): AugmentedTemplateResponse {
* @PublicPage
*/
public function link(string $token) {
\OC_User::setIncognitoMode(true);
$title = 'No title found';
$userName = 'Unknown';
try {
Expand Down

0 comments on commit 4ca639d

Please sign in to comment.