Index: reactapp/src/Pages/Home.js
===================================================================
--- reactapp/src/Pages/Home.js	(revision 702ca779afcdb48bcc15202ffc07dfb4be2efebd)
+++ reactapp/src/Pages/Home.js	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
@@ -6,5 +6,5 @@
 import AuthApi from "../api/AuthApi";
 
-function Home() {
+function Home({ user, userLoaded }) {
   const { auth, setAuth } = useContext(AuthApi);
 
@@ -24,5 +24,5 @@
       </a>{" "}
       <Search />
-      {auth && <UserHeader />}
+      {auth && <UserHeader user={user} userLoaded={userLoaded} />}
       <div style={{ marginTop: "140px" }}></div>
       <Outlet />
Index: reactapp/src/Pages/Professor.js
===================================================================
--- reactapp/src/Pages/Professor.js	(revision 702ca779afcdb48bcc15202ffc07dfb4be2efebd)
+++ reactapp/src/Pages/Professor.js	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
@@ -22,18 +22,19 @@
 import AuthApi from "../api/AuthApi";
 import { useNavigate } from "react-router-dom";
+import axios from "../api/axios";
 
-function Professor() {
+function Professor(user, userLoaded) {
   let params = useParams();
 
   let [professor, setProfessor] = useState(null);
   let [loaded, setLoaded] = useState(null);
-  let [modalDisplay, setModalDisplay] = useState("none");
+  let [postModalDisplay, setPostModalDisplay] = useState("none");
   let navigate = useNavigate();
   const { auth, setAuth } = useContext(AuthApi);
-  const [addPostTitle, setAddPostTitle] = useState("");
-  const [addPostContent, setAddPostContent] = useState("");
+  const [postTitle, setPostTitle] = useState("");
+  const [postContent, setPostContent] = useState("");
 
   useEffect(() => {
-    const url = `http://192.168.0.17:8080/public/professor/${params.professorId}`;
+    const url = `http://192.168.0.19:8080/public/professor/${params.professorId}`;
 
     const fetchData = async () => {
@@ -55,5 +56,5 @@
   const handleAddOpinionButtonClick = () => {
     if (auth) {
-      setModalDisplay("block");
+      setPostModalDisplay("block");
     } else {
       navigate("/login");
@@ -62,16 +63,31 @@
 
   const handleModalCloseClick = () => {
-    setModalDisplay("none");
-    console.log("here");
+    setPostModalDisplay("none");
   };
 
-  const handlePostSubmit = () => {};
+  const handlePostSubmit = async (e) => {
+    e.preventDefault();
+
+    const response = await axios(
+      `http://192.168.0.19:8080/secure/professor/${professor.professorId}/addOpinion`,
+      {
+        method: "post",
+        data: {
+          title: postTitle,
+          content: postContent,
+        },
+        withCredentials: true,
+      }
+    );
+
+    window.location.reload(false);
+  };
 
   const handleTitleChange = (e) => {
-    setAddPostTitle(e.target.value);
+    setPostTitle(e.target.value);
   };
 
   const handleContentChange = (e) => {
-    setAddPostContent(e.target.value);
+    setPostContent(e.target.value);
   };
 
@@ -100,10 +116,12 @@
             {professor.relatedOpinions.length !== 1 ? "мислења" : "мислење"}
           </h3>
-          <AddOpinionButton onClick={handleAddOpinionButtonClick}>
-            Објави мислење
-          </AddOpinionButton>
+          {auth && (
+            <AddOpinionButton onClick={handleAddOpinionButtonClick}>
+              Објави мислење
+            </AddOpinionButton>
+          )}
         </div>
 
-        <Modal display={modalDisplay}>
+        <Modal display={postModalDisplay}>
           <ModalContent>
             <ModalHeader>
@@ -113,16 +131,16 @@
               </h3>
             </ModalHeader>
-            <ModalBody>
-              <form onSubmit={handlePostSubmit}>
-                <label for="title">
+            <form onSubmit={handlePostSubmit}>
+              <ModalBody>
+                <label htmlFor="title">
                   <b>Наслов</b>:
                   <ModalInput
                     id="title"
                     type="text"
-                    value={addPostTitle}
+                    value={postTitle}
                     onChange={handleTitleChange}
                   />
                 </label>
-                <label for="content">
+                <label htmlFor="content">
                   <b>Содржина</b>:
                   <ModalTextarea
@@ -130,18 +148,20 @@
                     rows="8"
                     cols="100"
-                    value={addPostContent}
+                    value={postContent}
                     onChange={handleContentChange}
                   />
                 </label>
-              </form>
-            </ModalBody>
-            <ModalFooter>
-              <h2 style={{ textAlign: "center" }}>ОБЈАВИ</h2>
-            </ModalFooter>
+              </ModalBody>
+              <ModalFooter type="submit">ОБЈАВИ</ModalFooter>
+            </form>
           </ModalContent>
         </Modal>
 
         <div className="opinionTree">
-          <OpinionTree professor={professor} />
+          <OpinionTree
+            professor={professor}
+            user={user}
+            userLoaded={userLoaded}
+          />
         </div>
         <Outlet />
Index: reactapp/src/Pages/UserDashboard.js
===================================================================
--- reactapp/src/Pages/UserDashboard.js	(revision 702ca779afcdb48bcc15202ffc07dfb4be2efebd)
+++ reactapp/src/Pages/UserDashboard.js	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
@@ -1,5 +1,3 @@
-import React, { useState, useEffect } from "react";
-import JSOG from "jsog";
-import axios from "../api/axios";
+import React, { useEffect } from "react";
 import {
   OpinionCard,
@@ -14,29 +12,13 @@
 import { dateConverter } from "../Util/dateConverter";
 
-function UserDashboard() {
-  const [user, setUser] = useState(null);
-  const [loaded, setLoaded] = useState(false);
-
+function UserDashboard({ user, userLoaded }) {
   useEffect(() => {
-    const fetchData = async () => {
-      try {
-        const response = await axios.get(
-          "http://192.168.0.17:8080/secure/currentUser",
-          { withCredentials: true }
-        );
-        var cyclicGraph = await response.data;
-        var jsogStructure = JSOG.encode(cyclicGraph);
-        cyclicGraph = JSOG.decode(jsogStructure);
-        setUser(cyclicGraph);
-        setLoaded(true);
-      } catch (error) {
-        console.log("Fetching error", error);
-      }
-    };
-
-    fetchData();
+    const timer = setTimeout(() => {
+      if (user === null) window.location.reload(false);
+    }, 3000);
+    return () => clearTimeout(timer);
   }, []);
 
-  return loaded ? (
+  return userLoaded ? (
     <>
       <h3>Кориснички податоци:</h3>
