mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Logout blocked accounts.
This commit is contained in:
@@ -75,7 +75,7 @@ class AuthController extends Controller
|
||||
$foundUser = User::where('email', $credentials['email'])->where('blocked', 1)->first();
|
||||
if (!is_null($foundUser)) {
|
||||
// if it exists, show message:
|
||||
$code = $foundUser->blocked_code;
|
||||
$code = $foundUser->blocked_code ?? '';
|
||||
|
||||
if (strlen($code) == 0) {
|
||||
$code = 'general_blocked';
|
||||
|
@@ -6,7 +6,7 @@ namespace FireflyIII\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Session;
|
||||
/**
|
||||
* Class Authenticate
|
||||
*
|
||||
@@ -32,10 +32,12 @@ class Authenticate
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
} else {
|
||||
// if (intval(Auth::user()->blocked) === 1) {
|
||||
// Auth::guard($this->getGuard())->logout();
|
||||
// return redirect()->guest('login');
|
||||
// }
|
||||
if (intval(Auth::user()->blocked) === 1) {
|
||||
Auth::guard($guard)->logout();
|
||||
Session::flash('logoutMessage', trans('firefly.block_account_logout'));
|
||||
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
Reference in New Issue
Block a user