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

Commit 41c004d

Browse files
committed
Added Imported event to the DatabaseUserProvider
1 parent 9b67c01 commit 41c004d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Auth/DatabaseUserProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Adldap\Laravel\Facades\Resolver;
77
use Adldap\Laravel\Commands\Import;
88
use Adldap\Laravel\Commands\SyncPassword;
9+
use Adldap\Laravel\Events\Imported;
910
use Adldap\Laravel\Events\AuthenticationRejected;
1011
use Adldap\Laravel\Events\AuthenticationSuccessful;
1112
use Adldap\Laravel\Events\DiscoveredWithCredentials;
@@ -138,6 +139,12 @@ public function validateCredentials(Authenticatable $model, array $credentials)
138139

139140
$model->save();
140141

142+
if ($model->wasRecentlyCreated) {
143+
// If the model was recently created, they
144+
// have been imported successfully.
145+
Event::fire(new Imported($this->user, $model));
146+
}
147+
141148
Event::fire(new AuthenticationSuccessful($this->user, $model));
142149

143150
return true;

0 commit comments

Comments
 (0)