-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Hi,
as you can see in the following lines, the config is passed twice. Firstly to the constructor of the provider, and then with a setConfig
method.
Manager/src/SocialiteWasCalled.php
Lines 129 to 140 in 1de3f3d
protected function buildOAuth2Provider(SocialiteManager $socialite, $providerClass, $providerName) | |
{ | |
$this->classExtends($providerClass, \Laravel\Socialite\Two\AbstractProvider::class); | |
$config = $this->getConfig($providerClass, $providerName); | |
$provider = $socialite->buildProvider($providerClass, $config->get()); | |
$provider->setConfig($config); | |
return $provider; | |
} |
The setConfig
method is just about filling the config with the passed parameters, and so, totally overriding the previous work from builProvider
and provider constructor (which could be overridden by the dev)
Lines 17 to 27 in 1de3f3d
public function setConfig(ConfigInterface $config) | |
{ | |
$config = $config->get(); | |
$this->config = $config; | |
$this->clientId = $config['client_id']; | |
$this->clientSecret = $config['client_secret']; | |
$this->redirectUrl = $config['redirect']; | |
return $this; | |
} |
It can for example lead to this issue: #110
(actually, I've found that problem, because I had the same)
In my opinion we have to purely and simply remove the re-setting of attributes in setConfig.
I can make a quick PR to do that if you want.
Matt'