Index: frontend/src/Components/Hooks/Restaurant/useCreateMenu.js
===================================================================
--- frontend/src/Components/Hooks/Restaurant/useCreateMenu.js	(revision 07f4e8b52fa18ab7781f9660c09d7982d8cd5a0b)
+++ frontend/src/Components/Hooks/Restaurant/useCreateMenu.js	(revision 0f5aa2759dde06c45eeb640feeb15cb583c6af32)
@@ -7,5 +7,5 @@
 	const navigator = useNavigate();
 
-    const createMenu = async (id, menu) => {
+    const createMenu = async (id, menu, dep) => {
 		console.log(menu)
         console.log(id)
@@ -18,4 +18,5 @@
 					//navigator("/resources/restaurant/" + id)
 	                //history.push('/restaurant');
+					dep(prev => ++prev)
 	            })
 	            .catch((err) => {
Index: frontend/src/Components/Hooks/User/useCreateUser.js
===================================================================
--- frontend/src/Components/Hooks/User/useCreateUser.js	(revision 07f4e8b52fa18ab7781f9660c09d7982d8cd5a0b)
+++ frontend/src/Components/Hooks/User/useCreateUser.js	(revision 0f5aa2759dde06c45eeb640feeb15cb583c6af32)
@@ -10,5 +10,5 @@
 	            .post(`/register`, user) 
 	            .then((res) => {
-	                navigator("/login")
+	                window.location.href = "http://localhost:8080/login"
 	            })
 	            .catch((err) => {
Index: frontend/src/Components/Hooks/User/useLogin.js
===================================================================
--- frontend/src/Components/Hooks/User/useLogin.js	(revision 07f4e8b52fa18ab7781f9660c09d7982d8cd5a0b)
+++ frontend/src/Components/Hooks/User/useLogin.js	(revision 0f5aa2759dde06c45eeb640feeb15cb583c6af32)
@@ -1,64 +1,35 @@
-import React from "react";
-
+import { useState } from "react";
 import axios from "../../../axios.js";
-import { Navigate, useAsyncValue, useNavigate } from "react-router-dom";
-import LoginForm from "../../Login/LoginForm.js";
-import {useAuth} from "../../Context/AuthContext";
+import {useAuth} from "../../Context/AuthContext"; // Assuming you have axios configured
 
 const useLogin = () => {
+	const [loading, setLoading] = useState(false);
+	const [error, setError] = useState(null);
+	const Auth = useAuth();
 
-    const navigator = useNavigate()
-	const Auth = useAuth();
-    //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) => {
-					console.log("RES LOGIN")
-					console.log(res)
-					if(res.status === 200)
-					{
-						const user = {
-							sessionId: res.data.auth.details.sessionId,
-							userId: res.data.auth.principal.userID,
-							username: res.data.auth.principal.username,
-							role: res.data.auth.principal.role,
-							name: res.data.auth.principal.name,
-							surname: res.data.auth.principal.surname,
-						}
-						Auth.userLogin(user);
-						console.log(user)
-					}
-					const sessionId = res.data.auth.details.sessionId;
-					const userId = res.data.auth.principal.userID;
+	const handleLoginCallback = async () => {
+		setLoading(true);
 
-					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
+		loading,
+		error,
+		handleLoginCallback,
 	};
-
-}
+};
 
 export default useLogin;
Index: frontend/src/Components/Hooks/useCreate.js
===================================================================
--- frontend/src/Components/Hooks/useCreate.js	(revision 07f4e8b52fa18ab7781f9660c09d7982d8cd5a0b)
+++ frontend/src/Components/Hooks/useCreate.js	(revision 0f5aa2759dde06c45eeb640feeb15cb583c6af32)
@@ -15,6 +15,4 @@
             .then((res) => {
                 //history.push('/hotel');
-                console.log(res)
-                console.log("gotovo")
                 getData(prev => ++prev)
                 getData2(prev => ++prev)
