mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
instance check.
This commit is contained in:
parent
52a0d7cf7b
commit
635b9f9dba
@ -4,6 +4,7 @@ use App;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\Request;
|
||||
use Preferences;
|
||||
@ -45,6 +46,7 @@ class Authenticate
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
@ -53,7 +55,7 @@ class Authenticate
|
||||
}
|
||||
}
|
||||
|
||||
if (intval($this->auth->user()->blocked) == 1) {
|
||||
if ($this->auth->user() instanceof User && intval($this->auth->user()->blocked) == 1) {
|
||||
Auth::logout();
|
||||
|
||||
return redirect()->route('index');
|
||||
|
Loading…
Reference in New Issue
Block a user