Skip to content

Commit 2da1987

Browse files
committed
fix: prevent duplicate login name error when using EntraId, closes #3294
1 parent a2ce2ae commit 2da1987

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

phpmyfaq/src/phpMyFAQ/Auth/AuthEntraId.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,15 @@ public function __construct(
6262
*/
6363
public function create(string $login, #[SensitiveParameter] string $password, string $domain = ''): mixed
6464
{
65+
$result = false;
6566
$user = new User($this->configuration);
66-
$result = $user->createUser($login, '', $domain);
67+
68+
try {
69+
$result = $user->createUser($login, '', $domain);
70+
} catch (\Exception $e) {
71+
$this->configuration->getLogger()->info($e->getMessage());
72+
}
73+
6774
$user->setStatus('active');
6875
$user->setAuthSource(AuthenticationSourceType::AUTH_AZURE->value);
6976

0 commit comments

Comments
 (0)