Middleware Issue Fixed

This commit is contained in:
Devansh 2021-10-28 13:42:37 +05:30
parent e4a7c72c36
commit 687e13d49f
1 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,16 @@ class Bouncer
return redirect()->route('admin.session.create');
}
/**
* If user status is changed by admin. Then session should be
* logged out.
*/
if (! (bool) auth()->guard($guard)->user()->status) {
auth()->guard($guard)->logout();
return redirect()->route('admin.session.create');
}
/**
* If somehow the user deleted all permissions, then it should be
* auto logged out and need to contact the administrator again.