isLogin) { $newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login'); return $newResponse; } if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") { $newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable'); return $newResponse; } $response = $next($request, $response); return $response; } }