diff --git a/lib/Service/AppAPIService.php b/lib/Service/AppAPIService.php index 551d7c99..15699a23 100644 --- a/lib/Service/AppAPIService.php +++ b/lib/Service/AppAPIService.php @@ -21,6 +21,7 @@ use OCP\ICacheFactory; use OCP\IConfig; use OCP\IRequest; +use OCP\ISession; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; @@ -43,6 +44,7 @@ class AppAPIService { private IAppManager $appManager; private ISecureRandom $random; private IUserSession $userSession; + private ISession $session; private IUserManager $userManager; private ExAppApiScopeService $exAppApiScopeService; private ExAppUsersService $exAppUsersService; @@ -66,6 +68,7 @@ public function __construct( ExAppScopesService $exAppScopesService, ISecureRandom $random, IUserSession $userSession, + ISession $session, IUserManager $userManager, ExAppConfigService $exAppConfigService, ExNotificationsManager $exNotificationsManager, @@ -82,6 +85,7 @@ public function __construct( $this->appManager = $appManager; $this->random = $random; $this->userSession = $userSession; + $this->session = $session; $this->userManager = $userManager; $this->exAppUsersService = $exAppUserService; $this->exAppApiScopeService = $exAppApiScopeService; @@ -677,6 +681,7 @@ private function finalizeRequestToNC(string $userId, IRequest $request): bool { } else { $this->userSession->setUser(null); } + $this->session->set('app_api', true); $this->throttler->resetDelay($request->getRemoteAddress(), Application::APP_ID, [ 'appid' => $request->getHeader('EX-APP-ID'), 'userid' => $userId,