Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/externalauth
  • issue/externalauth-3132453
  • issue/externalauth-3211814
  • issue/externalauth-3213268
  • issue/externalauth-3217524
  • issue/externalauth-3179148
  • issue/externalauth-3280683
  • issue/externalauth-3253648
  • issue/externalauth-2910506
  • issue/externalauth-3291134
  • issue/externalauth-3302520
  • issue/externalauth-3315932
  • issue/externalauth-3362799
  • issue/externalauth-2972782
  • issue/externalauth-3179265
  • issue/externalauth-3430386
  • issue/externalauth-3398626
  • issue/externalauth-3452994
  • issue/externalauth-3421695
  • issue/externalauth-3467869
  • issue/externalauth-3303260
  • issue/externalauth-3496292
  • issue/externalauth-3496625
  • issue/externalauth-3497129
  • issue/externalauth-3503865
25 results
Show changes
Commits on Source (1)
......@@ -160,12 +160,26 @@ class ExternalAuth implements ExternalAuthInterface {
* {@inheritdoc}
*/
public function linkExistingAccount(string $authname, string $provider, UserInterface $account) {
// If a mapping (for the same provider) to this account already exists, we
// silently skip saving this auth mapping.
if (!$this->authmap->get($account->id(), $provider)) {
$authmap_event = $this->eventDispatcher->dispatch(new ExternalAuthAuthmapAlterEvent($provider, $authname, $account->getAccountName(), NULL), ExternalAuthEvents::AUTHMAP_ALTER);
$this->authmap->save($account, $provider, $authmap_event->getAuthname(), $authmap_event->getData());
// If a mapping (for the same provider) to this account already exists, and
// the authname is the same, we silently skip saving this auth mapping.
$current_authname = $this->authmap->get($account->id(), $provider);
if ($current_authname === $authname) {
return;
}
// If we update the authmap entry, let's log the change.
if (!empty($current_authname)) {
$this->logger->debug('Authmap change (%old => %new) for user %name with uid %uid from provider %provider', [
'%old' => $current_authname,
'%new' => $authname,
'%name' => $account->getAccountName(),
'%uid' => $account->id(),
'%provider' => $provider,
]);
}
$authmap_event = $this->eventDispatcher->dispatch(new ExternalAuthAuthmapAlterEvent($provider, $authname, $account->getAccountName(), NULL), ExternalAuthEvents::AUTHMAP_ALTER);
$this->authmap->save($account, $provider, $authmap_event->getAuthname(), $authmap_event->getData());
}
}