Skip to content

Commit

Permalink
fix: prevent duplicate login name error when using EntraId, closes #3294
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Dec 21, 2024
1 parent a2ce2ae commit 2da1987
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion phpmyfaq/src/phpMyFAQ/Auth/AuthEntraId.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ public function __construct(
*/
public function create(string $login, #[SensitiveParameter] string $password, string $domain = ''): mixed
{
$result = false;
$user = new User($this->configuration);
$result = $user->createUser($login, '', $domain);

try {
$result = $user->createUser($login, '', $domain);
} catch (\Exception $e) {
$this->configuration->getLogger()->info($e->getMessage());
}

$user->setStatus('active');
$user->setAuthSource(AuthenticationSourceType::AUTH_AZURE->value);

Expand Down

0 comments on commit 2da1987

Please sign in to comment.