You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (false === $userInstanceinstanceof Passportable) {
250
+
if (config('restify.auth.provider') === 'passport' && false === $userInstanceinstanceof Passportable) {
246
251
thrownewPassportUserException(__("User is not implementing Binaryk\LaravelRestify\Contracts\Passportable contract. User can use 'Laravel\Passport\HasApiTokens' trait"));
247
252
}
253
+
254
+
if (config('restify.auth.provider') === 'airlock' && false === $userInstanceinstanceof Airlockable) {
255
+
thrownewAirlockUserException(__("User is not implementing Binaryk\LaravelRestify\Contracts\Airlockable contract. User should use 'Laravel\Airlock\HasApiTokens' trait to provide"));
256
+
}
248
257
}
249
258
250
259
/**
@@ -302,9 +311,16 @@ public function logout()
302
311
* @var User
303
312
*/
304
313
$user = Auth::user();
305
-
if ($userinstanceof Authenticatable && $userinstanceof Passportable) {
306
-
$user->tokens()->get()->each->revoke();
307
-
event(newUserLogout($user));
314
+
if ($userinstanceof Authenticatable) {
315
+
if ($userinstanceof Passportable) {
316
+
$user->tokens->each->revoke();
317
+
event(newUserLogout($user));
318
+
}
319
+
320
+
if ($userinstanceof Airlockable) {
321
+
$user->tokens->each->delete();
322
+
event(newUserLogout($user));
323
+
}
308
324
} else {
309
325
thrownewAuthenticatableUserException(__('User is not authenticated.'));
0 commit comments