X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/388f2f40dc88727d18eeb7865dd1088691a3459e..refs/pull/494/head:/app/Services/SocialAuthService.php diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index 710f95696..2c15e73ce 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -181,14 +181,24 @@ class SocialAuthService public function getActiveDrivers() { $activeDrivers = []; - foreach ($this->validSocialDrivers as $driverName) { - if ($this->checkDriverConfigured($driverName)) { - $activeDrivers[$driverName] = true; + foreach ($this->validSocialDrivers as $driverKey) { + if ($this->checkDriverConfigured($driverKey)) { + $activeDrivers[$driverKey] = $this->getDriverName($driverKey); } } return $activeDrivers; } + /** + * Get the presentational name for a driver. + * @param $driver + * @return mixed + */ + public function getDriverName($driver) + { + return config('services.' . strtolower($driver) . '.name'); + } + /** * @param string $socialDriver * @param \Laravel\Socialite\Contracts\User $socialUser