diff --git a/app/Http/Controllers/Employee/DashboardController.php b/app/Http/Controllers/Employee/DashboardController.php index bdf3661..2bd894a 100644 --- a/app/Http/Controllers/Employee/DashboardController.php +++ b/app/Http/Controllers/Employee/DashboardController.php @@ -204,7 +204,7 @@ class DashboardController extends Controller 'rejection_note' => $activity->rejection_note, 'recorded_at' => $activity->recorded_at ? $activity->recorded_at->format('H:i') . ' WIB' : null, 'validated_at' => $activity->validated_at ? $activity->validated_at->format('H:i') . ' WIB' : null, - ]); + ])->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0'); } /** diff --git a/app/Http/Controllers/Pg/GateInspectionController.php b/app/Http/Controllers/Pg/GateInspectionController.php index 286d5c8..bb797ce 100644 --- a/app/Http/Controllers/Pg/GateInspectionController.php +++ b/app/Http/Controllers/Pg/GateInspectionController.php @@ -150,7 +150,7 @@ class GateInspectionController extends Controller 'count' => $pendingActivities->count(), 'items' => $items, 'html' => view('pg.partials.queue_cards', compact('pendingActivities', 'currentGuard', 'guards'))->render(), - ]); + ])->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0'); } /** diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7eec456..722e3cf 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,6 +23,11 @@ class AppServiceProvider extends ServiceProvider \Carbon\Carbon::setLocale('id'); date_default_timezone_set(config('app.timezone', 'Asia/Jakarta')); + // Deteksi HTTPS dari Cloudflare Reverse Proxy / Tunnel + if (request()->header('x-forwarded-proto') === 'https' || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') || str_starts_with(config('app.url'), 'https://')) { + \Illuminate\Support\Facades\URL::forceScheme('https'); + } + // Super Admin bypass: secara otomatis memiliki izin untuk semua ability Gate::before(function ($user, $ability) { if (in_array($user->role, ['super_admin', 'superadmin', 'admin'])) { diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index f963972..fc100b7 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -52,6 +52,7 @@ server { fastcgi_pass app:9000; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; + fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; fastcgi_hide_header X-Powered-By; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; diff --git a/resources/views/employee/dashboard.blade.php b/resources/views/employee/dashboard.blade.php index b4758f8..01e1a7e 100644 --- a/resources/views/employee/dashboard.blade.php +++ b/resources/views/employee/dashboard.blade.php @@ -1162,10 +1162,11 @@ isPollingInProgress = true; try { - const response = await fetch(`{{ route('employee.activity.status_polling') }}?activity_id=${activityId}`, { + const response = await fetch(`{{ route('employee.activity.status_polling', [], false) }}?activity_id=${activityId}&_t=${Date.now()}`, { headers: { 'Accept': 'application/json', - 'X-Requested-With': 'XMLHttpRequest' + 'X-Requested-With': 'XMLHttpRequest', + 'Cache-Control': 'no-cache' } }); diff --git a/resources/views/employee/history.blade.php b/resources/views/employee/history.blade.php index e53971b..7204d16 100644 --- a/resources/views/employee/history.blade.php +++ b/resources/views/employee/history.blade.php @@ -560,11 +560,11 @@ const pdfBtn = document.getElementById('modalDownloadPdfBtn'); const tableBody = document.getElementById('modalItemsTableBody'); - pdfBtn.href = "{{ url('/karyawan/riwayat/p2h') }}/" + recordId + "/pdf"; + pdfBtn.href = "{{ url('/karyawan/riwayat/p2h', [], false) }}/" + recordId + "/pdf"; tableBody.innerHTML = '