Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 7ad0bd2

Browse files
committed
Fire events during authentication and user discovery
1 parent 730ab3d commit 7ad0bd2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AdldapAuthUserProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Adldap\Models\User;
66
use Adldap\Laravel\Traits\ImportsUsers;
7+
use Adldap\Laravel\Events\DiscoveredWithCredentials;
8+
use Adldap\Laravel\Events\AuthenticatedWithCredentials;
79
use Illuminate\Support\Arr;
810
use Illuminate\Support\Facades\Config;
911
use Illuminate\Auth\EloquentUserProvider;
@@ -93,16 +95,14 @@ public function validateCredentials(Authenticatable $user, array $credentials)
9395
/**
9496
* Handle an authenticated LDAP user with their model.
9597
*
96-
* This method exists to be overridden.
97-
*
9898
* @param \Adldap\Models\User $user
9999
* @param Authenticatable $model
100100
*
101101
* @return void
102102
*/
103103
protected function handleAuthenticatedWithCredentials(User $user, $model)
104104
{
105-
//
105+
event(new AuthenticatedWithCredentials($user, $model));
106106
}
107107

108108
/**
@@ -114,7 +114,7 @@ protected function handleAuthenticatedWithCredentials(User $user, $model)
114114
*/
115115
protected function handleDiscoveredUserWithCredentials(User $user)
116116
{
117-
//
117+
event(new DiscoveredWithCredentials($user));
118118
}
119119

120120
/**

0 commit comments

Comments
 (0)