diff --git a/lib/User/Backend.php b/lib/User/Backend.php index 548e0350..2b4d9f3d 100644 --- a/lib/User/Backend.php +++ b/lib/User/Backend.php @@ -258,6 +258,7 @@ public function getCurrentUserId(): string { $this->eventDispatcher->dispatchTyped($validationEvent); $oidcProviderUserId = $validationEvent->getUserId(); if ($oidcProviderUserId !== null) { + $this->session->set('app_api', true); return $oidcProviderUserId; } else { $this->logger->debug('[NextcloudOidcProviderValidator] The bearer token validation has failed'); @@ -324,10 +325,12 @@ public function getCurrentUserId(): string { } $this->session->set('last-password-confirm', strtotime('+4 year', time())); + $this->session->set('app_api', true); return $userId; } elseif ($this->userExists($tokenUserId)) { $this->checkFirstLogin($tokenUserId); $this->session->set('last-password-confirm', strtotime('+4 year', time())); + $this->session->set('app_api', true); return $tokenUserId; } else { // check if the user exists locally @@ -349,6 +352,7 @@ public function getCurrentUserId(): string { } $this->checkFirstLogin($tokenUserId); $this->session->set('last-password-confirm', strtotime('+4 year', time())); + $this->session->set('app_api', true); return $tokenUserId; } }