From ab92df441a4a4439937660fc43d71b394cda6111 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 13 Jan 2025 11:59:50 +0100 Subject: [PATCH] move session set user id Signed-off-by: Julien Veyssier --- lib/Controller/LoginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/LoginController.php b/lib/Controller/LoginController.php index c8b57e87..4d121198 100644 --- a/lib/Controller/LoginController.php +++ b/lib/Controller/LoginController.php @@ -453,6 +453,7 @@ public function code(string $state = '', string $code = '', string $scope = '', // get user ID attribute $uidAttribute = $this->providerService->getSetting($providerId, ProviderService::SETTING_MAPPING_UID, 'sub'); $userId = $idTokenPayload->{$uidAttribute} ?? null; + $this->session->set(self::USER_ID, $userId); if ($userId === null) { $message = $this->l10n->t('Failed to provision the user'); return $this->build403TemplateResponse($message, Http::STATUS_BAD_REQUEST, ['reason' => 'failed to provision user']); @@ -502,7 +503,6 @@ public function code(string $state = '', string $code = '', string $scope = '', } $this->session->set(self::ID_TOKEN, $idTokenRaw); - $this->session->set(self::USER_ID, $user->getUID()); $this->logger->debug('Logging user in');