Pārlūkot izejas kodu

fixed auth middleware

Josh 4 gadi atpakaļ
vecāks
revīzija
3ad5a427d1
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      app/Http/Middleware/RedirectAuthenticatedPro.php

+ 2 - 2
app/Http/Middleware/RedirectAuthenticatedPro.php

@@ -17,9 +17,9 @@ class RedirectAuthenticatedPro
     public function handle($request, Closure $next)
     {
         $sessionKey = $request->cookie('sessionKey');
-        $appSession = AppSession::where('session_key', $sessionKey)->first();
+        $appSession = AppSession::where('session_key', $sessionKey)->where('is_active', true)->first();
 
-        if($appSession && $appSession->is_active && $appSession->pro) {
+        if($appSession && $appSession->pro) {
             return redirect()->route('dashboard');
         }