diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index f80aaaf9..9e26e475 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -1,7 +1,7 @@
import clsx from "clsx";
import {IconType} from "react-icons";
import {MdSpaceDashboard} from "react-icons/md";
-import {BsFileEarmarkText, BsClockHistory, BsPencil, BsGraphUp} from "react-icons/bs";
+import {BsFileEarmarkText, BsClockHistory, BsPencil, BsGraphUp, BsShield} from "react-icons/bs";
import {RiLogoutBoxFill} from "react-icons/ri";
import {SlPencil} from "react-icons/sl";
import {FaAward} from "react-icons/fa";
@@ -56,6 +56,7 @@ export default function Sidebar({path, navDisabled = false, focusMode = false, o
+
{
+ const user = req.session.user;
+
+ if (!user) {
+ res.setHeader("location", "/login");
+ res.statusCode = 302;
+ res.end();
+ return {
+ props: {
+ user: null,
+ },
+ };
+ }
+
+ return {
+ props: {user: req.session.user},
+ };
+}, sessionOptions);
+
+export default function Page() {
+ const {user} = useUser({redirectTo: "/login"});
+ const router = useRouter();
+ const handleManageQuestionsClick = () => {
+ router.push('/question-management');
+ };
+ return (
+ <>
+
+
IELTS GPT | Muscat Training Institute
+
+
+
+
+
+ {user && (
+
+
+
+
+
+ )}
+ >
+ );
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 23fd135d..489ad1fa 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -535,9 +535,9 @@
"resolved" "https://registry.npmjs.org/@next/font/-/font-13.1.6.tgz"
"version" "13.1.6"
-"@next/swc-darwin-arm64@13.1.6":
- "integrity" "sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw=="
- "resolved" "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.6.tgz"
+"@next/swc-win32-x64-msvc@13.1.6":
+ "integrity" "sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA=="
+ "resolved" "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.6.tgz"
"version" "13.1.6"
"@nodelib/fs.scandir@2.1.5":
@@ -1909,11 +1909,6 @@
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
"version" "1.0.0"
-"fsevents@~2.3.2":
- "integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
- "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
- "version" "2.3.2"
-
"function-bind@^1.1.1":
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"