From 9e235d984b7076cb61971afa022295edbd5ba171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 20 Dec 2023 17:09:42 +0100 Subject: [PATCH] fix: Also create skeleton for users from environment based auth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/SAMLController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Controller/SAMLController.php b/lib/Controller/SAMLController.php index 3e45d8829..3e94c0b67 100644 --- a/lib/Controller/SAMLController.php +++ b/lib/Controller/SAMLController.php @@ -260,7 +260,10 @@ public function login(int $idp = 1) { $this->userData->setAttributes($this->session->get('user_saml.samlUserData')); $this->autoprovisionIfPossible(); $user = $this->userResolver->findExistingUser($this->userBackend->getCurrentUserId()); - $user->updateLastLoginTimestamp(); + $firstLogin = $user->updateLastLoginTimestamp(); + if ($firstLogin) { + $this->userBackend->initializeHomeDir($user->getUID()); + } } catch (NoUserFoundException $e) { if ($e->getMessage()) { $this->logger->warning('Error while trying to login using sso environment variable: ' . $e->getMessage(), ['app' => 'user_saml']);