@@ -99,17 +99,9 @@ protected function registerListeners()
99
99
if ($ this ->isLogging ()) {
100
100
// If logging is enabled, we will set up our event listeners that
101
101
// log each event fired throughout the authentication process.
102
- Event::listen (Events \Importing::class, Listeners \LogImport::class);
103
- Event::listen (Events \Synchronized::class, Listeners \LogSynchronized::class);
104
- Event::listen (Events \Synchronizing::class, Listeners \LogSynchronizing::class);
105
- Event::listen (Events \Authenticated::class, Listeners \LogAuthenticated::class);
106
- Event::listen (Events \Authenticating::class, Listeners \LogAuthentication::class);
107
- Event::listen (Events \AuthenticationFailed::class, Listeners \LogAuthenticationFailure::class);
108
- Event::listen (Events \AuthenticationRejected::class, Listeners \LogAuthenticationRejection::class);
109
- Event::listen (Events \AuthenticationSuccessful::class, Listeners \LogAuthenticationSuccess::class);
110
- Event::listen (Events \DiscoveredWithCredentials::class, Listeners \LogDiscovery::class);
111
- Event::listen (Events \AuthenticatedWithWindows::class, Listeners \LogWindowsAuth::class);
112
- Event::listen (Events \AuthenticatedModelTrashed::class, Listeners \LogTrashedModel::class);
102
+ foreach ($ this ->getLoggingEvents () as $ event => $ listener ) {
103
+ Event::listen ($ event , $ listener );
104
+ }
113
105
}
114
106
}
115
107
@@ -152,6 +144,16 @@ protected function makeUserProvider(Hasher $hasher, array $config)
152
144
*/
153
145
protected function isLogging ()
154
146
{
155
- return Config::get ('adldap_auth.logging ' , false );
147
+ return Config::get ('adldap_auth.logging.enabled ' , false );
148
+ }
149
+
150
+ /**
151
+ * Returns the configured authentication events to log.
152
+ *
153
+ * @return array
154
+ */
155
+ protected function getLoggingEvents ()
156
+ {
157
+ return Config::get ('adldap_auth.logging.events ' , []);
156
158
}
157
159
}
0 commit comments