diff --git a/app/Views/pembelian/pembelian.php b/app/Views/pembelian/pembelian.php
index 136754b6965cd5fde68ee4035ffb21cd50394387..00d8ce4560b65c3e8d7c566cda67c1ad52ecbfbc 100644
--- a/app/Views/pembelian/pembelian.php
+++ b/app/Views/pembelian/pembelian.php
@@ -1,3 +1,14 @@
+<?php
+    session_start();
+    ob_start();
+    if (!isset($_SESSION["user_id"])) {
+        echo "here";
+        // User is not authenticated; redirect to login page
+        header("Location: /app/Views/login/login.php");
+        ob_end_flush();
+    }
+?>
+
 <!DOCTYPE html>
 <html lang="en">
 <head>