Index: frontend/src/Components/Hooks/FilesUpload/useFileChange.js
===================================================================
--- frontend/src/Components/Hooks/FilesUpload/useFileChange.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ 	(revision )
@@ -1,43 +1,0 @@
-import axios from "../../../axios";
-import { useState } from "react";
-
-const useFileChange = () => {
-    const [selectedFiles, setSelectedFiles] = useState([]);
-
-    const onFileChangeHandler = (files, type, id, refresh) => {
-        setSelectedFiles(files);
-
-        const formData = new FormData();
-
-        files.forEach((x) => formData.append('files', x))
-        //
-        // for (let i = 0; i < files.length; i++) {
-        //
-        // }
-
-
-        axios.post(`/upload/${type}/${id}`, formData, {
-            headers: {
-                'Content-Type': 'multipart/form-data'
-            }
-        })
-            .then(res => {
-                if (res.status === 200) {
-                    console.log(res.data);
-                    refresh((prev) => ++prev)
-                    alert("File(s) uploaded successfully.");
-                } else {
-                    console.error("File upload failed:", res.data);
-                    alert("File upload failed.");
-                }
-            })
-            .catch(error => {
-                console.error("Error uploading file(s):", error);
-                alert("An error occurred while uploading files.");
-            });
-    };
-
-    return { onFileChangeHandler, selectedFiles };
-};
-
-export default useFileChange;
Index: frontend/src/Components/Hooks/Hotel/useCreateHotel.js
===================================================================
--- frontend/src/Components/Hooks/Hotel/useCreateHotel.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/Hotel/useCreateHotel.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -6,8 +6,8 @@
 const useCreateHotel = () => {
 
+    //const history = useNavigate();
     const createHotel = async (hotel, edit) => {
 		console.log({hotel})
 		console.log(hotel)
-		console.log("vo createhotel")
 
 		if(!edit)
@@ -16,5 +16,5 @@
 			.post(`/hotel/add`, hotel, {
 				params: {
-					userId: JSON.parse(localStorage.getItem("user")).userId
+					userId: localStorage.getItem("userId")
 				}
 			}) 
Index: frontend/src/Components/Hooks/Restaurant/useCreateMenu.js
===================================================================
--- frontend/src/Components/Hooks/Restaurant/useCreateMenu.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/Restaurant/useCreateMenu.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -7,5 +7,5 @@
 	const navigator = useNavigate();
 
-    const createMenu = async (id, menu, dep) => {
+    const createMenu = async (id, menu) => {
 		console.log(menu)
         console.log(id)
@@ -18,5 +18,4 @@
 					//navigator("/resources/restaurant/" + id)
 	                //history.push('/restaurant');
-					dep(prev => ++prev)
 	            })
 	            .catch((err) => {
Index: frontend/src/Components/Hooks/Restaurant/useCreateRestaurant.js
===================================================================
--- frontend/src/Components/Hooks/Restaurant/useCreateRestaurant.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/Restaurant/useCreateRestaurant.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -15,5 +15,5 @@
 			.post(`/restaurant/add`, restaurant, {
 				params: {
-					userId: JSON.parse(localStorage.getItem('user')).userId,
+					userId: localStorage.getItem('userId')
 				}
 			}) 
Index: frontend/src/Components/Hooks/Restaurant/useCreateTable.js
===================================================================
--- frontend/src/Components/Hooks/Restaurant/useCreateTable.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/Restaurant/useCreateTable.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -13,5 +13,5 @@
 	            .then((res) => {
 					console.log(res)
-					refresh(Math.random())
+					refresh(prev => ++prev)
 	                //history.push('/restaurant');
 	            })
Index: frontend/src/Components/Hooks/Transport/useCreateTransport.js
===================================================================
--- frontend/src/Components/Hooks/Transport/useCreateTransport.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/Transport/useCreateTransport.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -4,10 +4,10 @@
 
 const useCreateTransport = () => {
-	const userId = JSON.parse(localStorage.getItem('user')).userId
+
     const createTransport = async (transport, edit) => {
 			if(!edit)
 			{
 				await axios
-	            .post(`/transport/add/` + userId, transport)
+	            .post(`/transport/add`, transport) 
 	            .then((res) => {
 	                //history.push('/transport');
Index: frontend/src/Components/Hooks/User/useCreateUser.js
===================================================================
--- frontend/src/Components/Hooks/User/useCreateUser.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/User/useCreateUser.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -10,5 +10,5 @@
 	            .post(`/register`, user) 
 	            .then((res) => {
-	                window.location.href = "http://localhost:8080/login"
+	                navigator("/login")
 	            })
 	            .catch((err) => {
Index: frontend/src/Components/Hooks/User/useLogin.js
===================================================================
--- frontend/src/Components/Hooks/User/useLogin.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/User/useLogin.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -1,35 +1,47 @@
-import { useState } from "react";
+import React from "react";
+
 import axios from "../../../axios.js";
-import {useAuth} from "../../Context/AuthContext"; // Assuming you have axios configured
+import { Navigate, useAsyncValue, useNavigate } from "react-router-dom";
+import LoginForm from "../../Login/LoginForm.js";
 
 const useLogin = () => {
-	const [loading, setLoading] = useState(false);
-	const [error, setError] = useState(null);
-	const Auth = useAuth();
 
-	const handleLoginCallback = async () => {
-		setLoading(true);
+    const navigator = useNavigate()
+    //const history = useNavigate();
+    const login = async (loginData) => {
+		console.log({loginData})
+		console.log(loginData)
+        await axios
+	            .post(`/api/login`, {
+                    username: loginData.email,
+                    password: loginData.password
+                }, {
+                    headers: { 
+                        "Content-Type": "application/x-www-form-urlencoded"
+                    }
+                }) 
+	            .then((res) => {
+					const sessionId = res.data.auth.details.sessionId;
+					const userId = res.data.auth.principal.userID;
+					
+					localStorage.setItem("sessionId", sessionId);
+					localStorage.setItem("userId", userId);
+					if(sessionId === null)
+					{
+					}
+                    navigator("/home")
+	            })
+	            .catch((err) => {
+	                console.log(err);
+	            })
+	            .finally(() => {
+	            });
+    }
 
-		try {
-			const response = await axios.get("http://localhost:8080/principal");
-
-			// Extract the needed attributes from the response
-			const { id, role, username } = response.data;
-
-			Auth.userLogin({userId: id, username: username, role: role})
-
-		} catch (err) {
-			setError(err.message);
-		} finally {
-			setLoading(false);
-		}
+	return {
+		login
 	};
 
-	return {
-		loading,
-		error,
-		handleLoginCallback,
-	};
-};
+}
 
 export default useLogin;
Index: frontend/src/Components/Hooks/useApprove.js
===================================================================
--- frontend/src/Components/Hooks/useApprove.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ 	(revision )
@@ -1,31 +1,0 @@
-import axios from "../../axios";
-import { useState, useEffect, useContext } from 'react';
-
-const useApprove = (url, dep) => {
-
-    const [data, setData] = useState(null);
-    const [isLoading, setIsLoading] = useState(true);
-    const [changed, setChanged] = useState(0)
-    const getData = async (uurl) => {
-        await axios.
-        get(uurl).then((res) => {
-            setData(res.data);
-        }).catch((error) => {
-            console.log(error)
-        })
-            .finally(() => {
-                setIsLoading(false);
-            });
-    };
-
-    return {
-        data,
-        setData,
-        isLoading,
-        getData,
-        setChanged
-    };
-};
-
-
-export default useApprove;
Index: frontend/src/Components/Hooks/useCreate.js
===================================================================
--- frontend/src/Components/Hooks/useCreate.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/useCreate.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -15,4 +15,5 @@
             .then((res) => {
                 //history.push('/hotel');
+                console.log(res)
                 getData(prev => ++prev)
                 getData2(prev => ++prev)
Index: frontend/src/Components/Hooks/useGet.js
===================================================================
--- frontend/src/Components/Hooks/useGet.js	(revision efaa05348a3e0dac884385ba4dd765baaeb47ec6)
+++ frontend/src/Components/Hooks/useGet.js	(revision e9b4ba920295b1b329df3313a9e80743d23804ee)
@@ -1,4 +1,4 @@
 import axios from "../../axios";
-import {useState, useEffect, useContext} from 'react';
+import { useState, useEffect, useContext } from 'react';
 
 const useGet = (url, dep) => {
@@ -11,15 +11,10 @@
         console.log(localStorage.getItem("sessionId"))
         console.log("url od get " + uurl)
-        await axios.get(uurl, {maxRedirects: 0}).then((res) => {
-            console.log(res);
-            // if(res.request.responseURL.includes('8080'))
-            // {
-            //     window.location.href = "/login"
-            // }
-            setData(res.data);
-        }).catch((error) => {
-            console.log(error)
-            // window.location.href = '/error'
-        })
+        await axios.
+            get(uurl).then((res) => {
+                setData(res.data);
+            }).catch((err) => {
+                console.log(err)
+            })
             .finally(() => {
                 setIsLoading(false);
@@ -31,5 +26,5 @@
         getData(url);
     }, [dep, url, changed]);
-
+    
     return {
         data,
