2
2
3
3
namespace Adldap \Laravel \Listeners ;
4
4
5
- use Adldap \Laravel \Auth \Provider ;
6
5
use Adldap \Laravel \Facades \Resolver ;
7
6
use Adldap \Laravel \Traits \HasLdapUser ;
7
+ use Adldap \Laravel \Auth \DatabaseUserProvider ;
8
8
use Illuminate \Support \Facades \Auth ;
9
9
use Illuminate \Contracts \Auth \Authenticatable ;
10
10
@@ -13,7 +13,7 @@ class BindsLdapUserModel
13
13
/**
14
14
* Binds the LDAP user record to their model.
15
15
*
16
- * @param mixed $event
16
+ * @param \Illuminate\Auth\Events\Login|\Illuminate\Auth\Events\Authenticated $event
17
17
*
18
18
* @return void
19
19
*/
@@ -23,7 +23,7 @@ public function handle($event)
23
23
// Adldap authentication provider, the required trait, and the
24
24
// users LDAP property has not already been set.
25
25
if (
26
- $ this ->isUsingAdldapProvider ()
26
+ $ this ->isUsingAdldapProvider ($ event -> guard )
27
27
&& $ this ->canBind ($ event ->user )
28
28
&& is_null ($ event ->user ->ldap )
29
29
) {
@@ -36,11 +36,13 @@ public function handle($event)
36
36
/**
37
37
* Determines if the Auth Provider is an instance of the Adldap Provider.
38
38
*
39
+ * @param string $guard
40
+ *
39
41
* @return bool
40
42
*/
41
- protected function isUsingAdldapProvider () : bool
43
+ protected function isUsingAdldapProvider ($ guard ) : bool
42
44
{
43
- return Auth::getProvider () instanceof Provider ;
45
+ return Auth::guard ( $ guard )-> getProvider () instanceof DatabaseUserProvider ;
44
46
}
45
47
46
48
/**
0 commit comments