Commit e7f82652 authored by Tyler Struyk's avatar Tyler Struyk
Browse files

reference patch locally instead of relying on drupal.org

parent bb36185f
# ignores all .lock recursive from the base folder
**.lock
modules
themes
/modules
/themes
......@@ -94,7 +94,7 @@
},
"patches": {
"drupal/externalauth": {
"ISTWCMS-2267: Remove provider prefix to username (saml_)": "https://www.drupal.org/files/issues/2798323-externalauth-11.patch"
"ISTWCMS-2267: Remove provider prefix to username (saml_)": "patches/modules/externalauth/2798323-externalauth-11.patch"
}
}
}
......
diff --git a/src/ExternalAuth.php b/src/ExternalAuth.php
index 2811d48..b49e1b3 100644
--- a/src/ExternalAuth.php
+++ b/src/ExternalAuth.php
@@ -91,7 +91,8 @@ public function login($authname, $provider) {
* {@inheritdoc}
*/
public function register($authname, $provider, $account_data = array(), $authmap_data = NULL) {
- $username = $provider . '_' . $authname;
+ $username = $authname;
+
$authmap_event = $this->eventDispatcher->dispatch(ExternalAuthEvents::AUTHMAP_ALTER, new ExternalAuthAuthmapAlterEvent($provider, $authname, $username, $authmap_data));
$entity_storage = $this->entityManager->getStorage('user');
@@ -104,7 +105,6 @@ public function register($authname, $provider, $account_data = array(), $authmap
$account_data = array_merge(
[
'name' => $authmap_event->getUsername(),
- 'init' => $provider . '_' . $authmap_event->getAuthname(),
'status' => 1,
'access' => (int) $_SERVER['REQUEST_TIME'],
],
@@ -158,7 +158,7 @@ public function linkExistingAccount($authname, $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)) {
- $username = $provider . '_' . $authname;
+ $username = $authname;
$authmap_event = $this->eventDispatcher->dispatch(ExternalAuthEvents::AUTHMAP_ALTER, new ExternalAuthAuthmapAlterEvent($provider, $authname, $username, NULL));
$this->authmap->save($account, $provider, $authmap_event->getAuthname(), $authmap_event->getData());
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment