{{ 'connect.confirm.text' | trans({'%service%': resourceOwnerConfig[service].serviceName | trans({}, 'HWIOAuthBundle'), '%name%': userInformation.realName}, 'HWIOAuthBundle') }}
+{{ 'connect.confirm.text' | trans({ + '%service%': externalAccountProviderManager.getProviderByName('oauth_'~service).serviceName, + '%name%': userInformation.realName + }, 'HWIOAuthBundle') }}
{{ form_start(form, {'action': path('hwi_oauth_connect_service', {'service': service, 'key': key})}) }} {{ form_widget(form) }} diff --git a/Resources/views/Connect/disconnect_service.html.twig b/Resources/views/Connect/disconnect_service.html.twig index 33009ea..b5825b0 100644 --- a/Resources/views/Connect/disconnect_service.html.twig +++ b/Resources/views/Connect/disconnect_service.html.twig @@ -9,7 +9,7 @@
Are you sure you want to disconnect your {{ resourceOwnerConfig[externalUser.provider].serviceName }} account "{{ externalUser.providerFriendlyName }}"?
+Are you sure you want to disconnect your {{ externalAccountProviderManager.getProviderForExternalUserUnsafe(externalUser).serviceName }} account "{{ externalUser.providerFriendlyName }}"?
{{ form_start(form) }} {{ form_widget(form) }} diff --git a/Security/Core/User/OAuthUserProvider.php b/Security/Core/User/OAuthUserProvider.php index 30429fc..624a0b5 100644 --- a/Security/Core/User/OAuthUserProvider.php +++ b/Security/Core/User/OAuthUserProvider.php @@ -72,7 +72,7 @@ class OAuthUserProvider extends UserProvider implements OAuthAwareUserProviderIn } $externalUser = new ExternalUser(); $externalUser->setUser($user); - $externalUser->setProvider($response->getResourceOwner()->getName()); + $externalUser->setProvider('oauth_'.$response->getResourceOwner()->getName()); $externalUser->setProviderRef($response->getUsername()); $externalUser->setProviderFriendlyName($response->getRealName()); $this->getManager()->persist($externalUser); @@ -110,7 +110,7 @@ class OAuthUserProvider extends UserProvider implements OAuthAwareUserProviderIn $repo = $this->getRepo(); $externalAccount = $repo->findOneBy([ - 'provider' => $response->getResourceOwner()->getName(), + 'provider' => 'oauth_'. $response->getResourceOwner()->getName(), 'provider_ref' => $response->getUsername() ]); diff --git a/composer.json b/composer.json index 83e352c..8f35bda 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,9 @@ "vierbergenlars\\AuthserverOAuthAccountBundle\\": "." } }, + "config": { + "prepend-autoloader": false + }, "license": "AGPL", "authors": [ {