diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx
index 4674f0be..e7877956 100644
--- a/src/components/Navbar.jsx
+++ b/src/components/Navbar.jsx
@@ -15,7 +15,7 @@ const Navbar = () => {
navigate("/user/profile");
}
- if (sessionStorage.getItem("club")) {
+ if (Cookies.get("club")) {
navigate("/clubs/profile");
}
};
@@ -74,7 +74,7 @@ const Navbar = () => {
{/* Auth0 will be implemented later on*/}
{/* The basic JWT Auths will be removed to reduce hassle */}
- {(Cookies.get("token") || sessionStorage.getItem("club")) &&
+ {(Cookies.get("token") || Cookies.get("club")) &&
{
- const [login, setLogin] = useState(Cookies.get("token") || sessionStorage.getItem("club"));
+ const [login, setLogin] = useState(Cookies.get("token") || Cookies.get("club"));
return login;
};
const Home = () => {
@@ -21,7 +21,7 @@ const Home = () => {
{AuthState() ? : }
- {sessionStorage.getItem("club") ? : }
+ {Cookies.get("club") ? : }
>
);
diff --git a/src/pages/clubs/ClubProfile.jsx b/src/pages/clubs/ClubProfile.jsx
index db68114f..8a2cc1f0 100644
--- a/src/pages/clubs/ClubProfile.jsx
+++ b/src/pages/clubs/ClubProfile.jsx
@@ -2,14 +2,14 @@ import React from 'react'
import { useNavigate } from 'react-router-dom'
import comingsoon from '../../assets/pictures/comingsoon.svg'
import Navbar from '../../components/Navbar'
-
+import Cookies from "js-cookie";
const ClubProfile = () => {
const Navigate = useNavigate()
const handleLogout = () => {
window.alert("Logout successful !")
- sessionStorage.removeItem("club")
+ Cookies.remove("club");
Navigate("/clubs/login")
}
diff --git a/src/pages/clubs/ClubsLogin.jsx b/src/pages/clubs/ClubsLogin.jsx
index d6de8460..fdaf5bde 100644
--- a/src/pages/clubs/ClubsLogin.jsx
+++ b/src/pages/clubs/ClubsLogin.jsx
@@ -7,7 +7,7 @@ import { LoginClub } from "../../service/MilanApi";
import { Audio, Oval, TailSpin } from "react-loader-spinner";
import { toast, ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
-
+import Cookies from 'js-cookie';
function ClubLogin() {
@@ -52,8 +52,8 @@ function ClubLogin() {
Data.then((response) => {
if (response.data.success === true) {
-
- sessionStorage.setItem("club", response.data.authToken);
+
+ Cookies.set("club",response.data.authToken);
toast('🌈 Logged you in !', {
position: "top-right",