Skip to content

Commit

Permalink
move session set user id
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Jan 13, 2025
1 parent 67fd4f1 commit ab92df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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');

Expand Down

0 comments on commit ab92df4

Please sign in to comment.