forked from humhub/auth-linkedin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvents.php
29 lines (24 loc) · 813 Bytes
/
Events.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace humhubContrib\auth\linkedin;
use humhub\components\Event;
use humhub\modules\user\authclient\Collection;
use humhubContrib\auth\linkedin\authclient\LinkedinAuth;
use humhubContrib\auth\linkedin\models\ConfigureForm;
class Events
{
/**
* @param Event $event
*/
public static function onAuthClientCollectionInit($event)
{
/** @var Collection $authClientCollection */
$authClientCollection = $event->sender;
if (!empty(ConfigureForm::getInstance()->enabled)) {
$authClientCollection->setClient('linkedin', [
'class' => LinkedinAuth::class,
'clientId' => ConfigureForm::getInstance()->clientId,
'clientSecret' => ConfigureForm::getInstance()->clientSecret
]);
}
}
}