Merge pull request #24628 from nextcloud/bugfix/noid/ocs-endpoint-load-issues

Fix loading order for OCS endpoints
This commit is contained in:
Joas Schilling 2020-12-10 10:43:54 +01:00 committed by GitHub
commit 16be144aab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -51,13 +51,16 @@ use Symfony\Component\Routing\Exception\MethodNotAllowedException;
try {
OC_App::loadApps(['session']);
OC_App::loadApps(['authentication']);
// load all apps to get all api routes properly setup
// FIXME: this should ideally appear after handleLogin but will cause
// side effects in existing apps
OC_App::loadApps();
if (!\OC::$server->getUserSession()->isLoggedIn()) {
OC::handleLogin(\OC::$server->getRequest());
}
// load all apps to get all api routes properly setup
OC_App::loadApps();
OC::$server->get(\OC\Route\Router::class)->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo());
} catch (ResourceNotFoundException $e) {
OC_API::setContentType();