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